pyparsing and pygments are now actual dependencies.

For political reasons I have made pyparsing and pygments actual dependencies.
It seems that unless bpython actually won't work without these two packages
then certain Norwegian people will not package bpython for Ubuntu with them
as actual dependencies, meaning people would have to apt-get install them
separately (by which point they would probably have decided bpython sucks and
won't ever use it again). Jorgen is right, though - they are a huge part
of what makes bpython what it is, so they should be dependencies.
This commit is contained in:
Bob Farrell
2008-08-19 09:42:21 +01:00
parent bdc4320a72
commit 3786392274
+9 -25
View File
@@ -43,7 +43,7 @@ import termios
import fcntl
import string
import shlex
from bpython.formatter import BPythonFormatter
import pydoc
class Dummy( object ):
pass
@@ -51,31 +51,15 @@ OPTS = Dummy()
OPTS.auto_display_list = True
try:
from pygments import highlight
from pygments.lexers import PythonLexer
except ImportError:
OPTS.syntax = False
else:
OPTS.syntax = True
from pygments import highlight
from pygments.lexers import PythonLexer
from bpython.formatter import BPythonFormatter
OPTS.syntax = True
try:
from pyparsing import Forward, Suppress, QuotedString, dblQuotedString, \
Group, OneOrMore, ZeroOrMore, Literal, Optional, Word, \
alphas, alphanums, printables, ParseException
except ImportError:
OPTS.arg_spec = False
print ("pyparsing could not be imported properly, "
"parameter list spec will not work." )
# XXX: This is for later, as the loadrc function checks that it got imported okay.
# pyparsing will still be in sys.modules even if only part of the import works, so
# this makes sure only a clean import happens or no import at all.
if 'pyparsing' in sys.modules:
del sys.modules['pyparsing']
else:
OPTS.arg_spec = True
import pydoc
from pyparsing import Forward, Suppress, QuotedString, dblQuotedString, \
Group, OneOrMore, ZeroOrMore, Literal, Optional, Word, \
alphas, alphanums, printables, ParseException
OPTS.arg_spec = True
# TODO:
#