File: ppppconfig.py

package info (click to toggle)
pymacs 0.25-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 772 kB
  • sloc: python: 3,542; lisp: 740; makefile: 79; sh: 34
file content (64 lines) | stat: -rw-r--r-- 1,783 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# -*- coding: utf-8 -*-
# p4 configuration for Pymacs.

# Overall Pymacs configuration
# ============================

# VERSION is the name of the Pymacs version, as declared within setup.py.

def get_version():
    import re
    for line in open('setup.py'):
        match = re.match('version *= *([\'"][^\'"]*[\'"])', line)
        if match:
            return eval(match.group(1))

VERSION = get_version()
del get_version

# Configuration for the Emacs Lisp side
# =====================================

# DEFADVICE_OK is 't' when it is safe to use defadvice.  It has been reported
# that, at least under Aquamacs (an MacOS X native port of Emacs), one gets
# "Lisp nesting exceeds `max-lisp-eval-depth'" messages while requesting
# functions documentation (we do not know why).  Set this variable to 'nil'
# as a way to avoid the problem.

DEFADVICE_OK = 't'

# PYTHON gets the command name of the Python interpreter.

def get_python():
    import os
    return os.getenv('PYTHON') or 'python'

PYTHON = get_python()
del get_python

# Configuration for Python (Pymacs helper)
# ========================================

# It has been reported that intercepting all signals (and optionally writing
# a trace of them, create IO problems within the Pymacs helper itself.  So for
# now, IO_ERRORS_WITH_SIGNALS is blindly set to True, until I know better.
# When True, only the Interrupt signal gets monitored.

IO_ERRORS_WITH_SIGNALS = True

# OLD_EXCEPTIONS is True for old Python or Jython versions.

def get_old_exceptions():
    return not isinstance(Exception, type)

OLD_EXCEPTIONS = get_old_exceptions()
del get_old_exceptions

# PYTHON3 is True within Python 3.

def get_python3():
    import sys
    return sys.version_info[0] == 3

PYTHON3 = get_python3()
del get_python3