sample-rc included with package

This commit is contained in:
Bob Farrell
2008-06-24 18:07:49 +01:00
parent 3382036844
commit fe4b4fc988
4 changed files with 41 additions and 16 deletions
+5
View File
@@ -1,3 +1,8 @@
v0.5.3
======
Now you can configure a ~/.bpythonrc file (or pass a rc file at the
command line (bpython /foo/bar). See README for details.
v0.5.2
======
help() actually displays the full help page, and I fixed up the
+8 -8
View File
@@ -95,16 +95,16 @@ as you type.
the screen data will be flushed to stdout, so it basically
looks the same as if you had quit the vanilla interpreter.
Configuration
=============
See the sample-rc file for a list of available options.
You should save your rc file as ~/.bpythonrc or specify
at the command line:
bpython /path/to/bpythonrc
Known Bugs
==========
* There's some weirdness when you use rewind sometimes with how
it displays the text afterwards, I haven't had enough time to
sit down and look at exactly what's causing it, as it doesn't
seem to happen a lot, and it fixes itself pretty quickly anyway.
* Triple quoted strings over multiple lines work, but they're
not highlighted properly.
* There is no way to configure the keys or the pastebin options,
this is a definite for the next release.
+13 -8
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# bpython 0.5.2::fancy curses interface to the Python repl::Bob Farrell 2008
# bpython 0.5.3::fancy curses interface to the Python repl::Bob Farrell 2008
#
# The MIT License
#
@@ -64,9 +64,9 @@ try:
Group, OneOrMore, ZeroOrMore, Literal, Optional, Word, \
alphas, alphanums, printables, ParseException
except ImportError:
OPTS.argspec = False
OPTS.arg_spec = False
else:
OPTS.argspec = True
OPTS.arg_spec = True
import pydoc
@@ -219,7 +219,7 @@ class Repl( object ):
self.list_win_visible = False
if not OPTS.argspec:
if not OPTS.arg_spec:
return
pexp = Forward()
@@ -328,7 +328,7 @@ class Repl( object ):
r = t
return r
if not OPTS.argspec:
if not OPTS.arg_spec:
return False
t = parse_parens( self.s )
@@ -1400,8 +1400,10 @@ def loadrc():
bools = {
'true': True,
'yes': True,
'on': True,
'false': False,
'no': False
'no': False,
'off': False
}
config = {}
@@ -1412,9 +1414,12 @@ def loadrc():
if not k:
break
k = k.lower()
if parser.get_token() == '=':
v = parser.get_token() or None
print v
if v is not None:
try:
v = int(v)
@@ -1423,9 +1428,9 @@ def loadrc():
v = bools[v.lower()]
config[k] = v
f.close()
for k in config:
for k, v in config.iteritems():
if hasattr( OPTS, k ):
setattr( OPTS, k, v )
+15
View File
@@ -0,0 +1,15 @@
# positives: yes, true, on
# negatives: no, false, off
# This is parsed using shlex, so any future versions that use
# string options and stuff should be escaped properly.
# Display the autocomplete list as you type (default: on).
# When this is off, you can hit tab to see the suggestions.
auto_display_list = yes
# Syntax highlighting as you type (default: on).
syntax = on
# Display the arg spec (list of arguments) for callables,
# when possible (default: on).
arg_spec = true