forked from whiteinge/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pdbrc
32 lines (26 loc) · 935 Bytes
/
.pdbrc
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
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498182
import os
import sys
# import rlcompleter early, as it contains side effects
import rlcompleter
# refresh the terminal
os.system("stty sane")
# this rc file takes single lines, so define our complete function here
execfile(os.path.expanduser("~/.pdbrc.py"))
# replace the Pdb class's complete method with ours
sys._getframe(1).f_globals['Pdb'].complete = complete
# set use_rawinput to 1 as tab completion relies on rawinput being used
sys._getframe(1).f_locals['self'].use_rawinput = 1
# Make pprint quickly available
from pprint import pprint as __pprint
alias pp __pprint(%1)
# Print the member variables of a thing.
alias pi p_ %1.__dict__ %1.
# Print the instance variables of self.
alias ps pi self
# Next and list, and step and list.
alias nl n;;l
alias sl s;;l
# Always list the current line, even if you already listed it
alias ll u;;d;;l
# vim:ft=python