]> git.phdru.name Git - dotfiles.git/blob - .pdbrc
pdb: Improve completion
[dotfiles.git] / .pdbrc
1 # http://wiki.python.org/moin/PdbRcIdea
2
3 # .pdbrc only allows for debugger commands; you cannot insert Python scripts.
4
5 # To overcome this restriction, this .pdbrc executes pdbrc.py,
6 # which can contain arbitrary Python commands.
7
8 # If pdbrc.py is missing, you get an error message (which doesn't hurt).
9
10 import os
11 import sys
12
13 x = execfile(os.path.expanduser("~/lib/python/pdbrc.py"))
14
15 # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498182
16 # replace the Pdb class's complete method with ours
17 sys._getframe(1).f_globals['Pdb'].complete = complete
18 # set use_rawinput to 1 as tab completion relies on rawinput being used
19 sys._getframe(1).f_locals['self'].use_rawinput = 1