-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pdbrc.py
43 lines (36 loc) · 1.46 KB
/
.pdbrc.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
def complete(self, text, state):
"""return the next possible completion for text, using the current frame's
local namespace
This is called successively with state == 0, 1, 2, ... until it
returns None. The completion should begin with 'text'.
"""
# keep a completer class, and make sure that it uses the current local scope
if not hasattr(self, 'completer'):
self.completer = rlcompleter.Completer(self.curframe.f_locals)
else:
self.completer.namespace = self.curframe.f_locals
return self.completer.complete(text, state)
'''
import readline
import pdb
# make 'l' an alias to 'longlist'
#pdb.Pdb.do_l = pdb.Pdb.do_longlist
#pdb.Pdb.do_st = pdb.Pdb.do_sticky
class Config(pdb.DefaultConfig):
def __init__(self):
readline.parse_and_bind('set convert-meta on')
readline.parse_and_bind('Meta-/: complete')
try:
from pygments.formatters import terminal
except ImportError:
pass
else:
self.colorscheme = terminal.TERMINAL_COLORS.copy()
self.colorscheme.update({
terminal.Keyword: ('darkred', 'red'),
terminal.Number: ('darkyellow', 'yellow'),
terminal.String: ('brown', 'green'),
terminal.Name.Function: ('darkgreen', 'blue'),
terminal.Name.Namespace: ('teal', 'turquoise'),
})
'''