Skip to content

Commit fe65e5e

Browse files
author
Bob Farrell
committed
sample-rc included with package
committer: Bob Farrell <bob@keys.(none)>
1 parent b495348 commit fe65e5e

4 files changed

Lines changed: 41 additions & 16 deletions

File tree

‎CHANGELOG‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v0.5.3
2+
======
3+
Now you can configure a ~/.bpythonrc file (or pass a rc file at the
4+
command line (bpython /foo/bar). See README for details.
5+
16
v0.5.2
27
======
38
help() actually displays the full help page, and I fixed up the

‎README‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ as you type.
9595
the screen data will be flushed to stdout, so it basically
9696
looks the same as if you had quit the vanilla interpreter.
9797

98+
Configuration
99+
=============
100+
See the sample-rc file for a list of available options.
101+
You should save your rc file as ~/.bpythonrc or specify
102+
at the command line:
103+
104+
bpython /path/to/bpythonrc
105+
98106
Known Bugs
99107
==========
100108

101-
* There's some weirdness when you use rewind sometimes with how
102-
it displays the text afterwards, I haven't had enough time to
103-
sit down and look at exactly what's causing it, as it doesn't
104-
seem to happen a lot, and it fixes itself pretty quickly anyway.
105-
106109
* Triple quoted strings over multiple lines work, but they're
107110
not highlighted properly.
108-
109-
* There is no way to configure the keys or the pastebin options,
110-
this is a definite for the next release.

‎bpython.py‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# bpython 0.5.2::fancy curses interface to the Python repl::Bob Farrell 2008
2+
# bpython 0.5.3::fancy curses interface to the Python repl::Bob Farrell 2008
33
#
44
# The MIT License
55
#
@@ -64,9 +64,9 @@ class Dummy( object ):
6464
Group, OneOrMore, ZeroOrMore, Literal, Optional, Word, \
6565
alphas, alphanums, printables, ParseException
6666
except ImportError:
67-
OPTS.argspec = False
67+
OPTS.arg_spec = False
6868
else:
69-
OPTS.argspec = True
69+
OPTS.arg_spec = True
7070

7171
import pydoc
7272

@@ -219,7 +219,7 @@ def __init__( self, scr, interp, statusbar=None, idle=None):
219219
self.list_win_visible = False
220220

221221

222-
if not OPTS.argspec:
222+
if not OPTS.arg_spec:
223223
return
224224

225225
pexp = Forward()
@@ -328,7 +328,7 @@ def walk( seq ):
328328
r = t
329329
return r
330330

331-
if not OPTS.argspec:
331+
if not OPTS.arg_spec:
332332
return False
333333

334334
t = parse_parens( self.s )
@@ -1400,8 +1400,10 @@ def loadrc():
14001400
bools = {
14011401
'true': True,
14021402
'yes': True,
1403+
'on': True,
14031404
'false': False,
1404-
'no': False
1405+
'no': False,
1406+
'off': False
14051407
}
14061408

14071409
config = {}
@@ -1412,9 +1414,12 @@ def loadrc():
14121414
if not k:
14131415
break
14141416

1417+
k = k.lower()
1418+
14151419
if parser.get_token() == '=':
14161420
v = parser.get_token() or None
14171421

1422+
print v
14181423
if v is not None:
14191424
try:
14201425
v = int(v)
@@ -1423,9 +1428,9 @@ def loadrc():
14231428
v = bools[v.lower()]
14241429

14251430
config[k] = v
1426-
1431+
f.close()
14271432

1428-
for k in config:
1433+
for k, v in config.iteritems():
14291434
if hasattr( OPTS, k ):
14301435
setattr( OPTS, k, v )
14311436

‎sample-rc‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# positives: yes, true, on
2+
# negatives: no, false, off
3+
# This is parsed using shlex, so any future versions that use
4+
# string options and stuff should be escaped properly.
5+
6+
# Display the autocomplete list as you type (default: on).
7+
# When this is off, you can hit tab to see the suggestions.
8+
auto_display_list = yes
9+
10+
# Syntax highlighting as you type (default: on).
11+
syntax = on
12+
13+
# Display the arg spec (list of arguments) for callables,
14+
# when possible (default: on).
15+
arg_spec = true

0 commit comments

Comments
 (0)