]> git.phdru.name Git - dotfiles.git/blob - .pdbrc
.vimrc: Set `visualbell` and `belloff`
[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 = sys.version_info[:2] == (2, 7) and execfile(os.path.expanduser("~/lib/python/pdbrc.py"))
14 # In Python 2.7 ``exec()`` raises SyntaxError. Ignore it, it's harmless here.
15 x = sys.version_info >= (3, 4) and exec(open(os.path.expanduser("~/lib/python/pdbrc.py"), 'rU').read())
16
17 # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498182
18 # replace the Pdb class's complete method with ours
19 sys._getframe(1).f_globals['Pdb'].complete = complete
20 # set use_rawinput to 1 as tab completion relies on rawinput being used
21 sys._getframe(1).f_locals['self'].use_rawinput = 1