forked from pinard/Pymacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ppppconfig.py
70 lines (45 loc) · 1.75 KB
/
ppppconfig.py
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
65
66
67
68
69
70
# -*- 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():
for line in open('setup.cfg'):
if '=' in line:
key, value = line.split('=', 1)
if key.strip() == 'version':
return value.strip()
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 (a 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