summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-06-08 20:28:50 +0100
committerMatthew Lemon <y@yulqen.org>2023-06-08 20:28:50 +0100
commit90723c67eaff5fdfd9169796b06e95d457475137 (patch)
treec5e605115d094b80fdcbf39e062a10998a8635aa
parent83bc413a4abf0e87de4a66e9569efa90c6edce79 (diff)
moved in pdbrc config files
Diffstat (limited to '')
-rw-r--r--pdbrc30
-rw-r--r--pdbrc.py63
2 files changed, 93 insertions, 0 deletions
diff --git a/pdbrc b/pdbrc
new file mode 100644
index 0000000..f332aa7
--- /dev/null
+++ b/pdbrc
@@ -0,0 +1,30 @@
+Ned's .pdbrc
+
+# Print a dictionary, sorted. %1 is the dict, %2 is the prefix for the names.
+alias p_ for k in sorted(%1.keys()): print "%s%-15s= %-80.80s" % ("%2",k,repr(%1[k]))
+
+# Print the instance variables of a thing.
+alias pi p_ %1.__dict__ %1.
+
+# Print the instance variables of self.
+alias ps pi self
+
+# Print the locals.
+alias pl p_ locals() local:
+
+# Next and list, and step and list.
+alias nl n;;l
+alias sl s;;l
+
+# Short cuts for walking up and down the stack
+alias uu u;;u
+alias uuu u;;u;;u
+alias uuuu u;;u;;u;;u
+alias uuuuu u;;u;;u;;u;;u
+alias dd d;;d
+alias ddd d;;d;;d
+alias dddd d;;d;;d;;d
+alias ddddd d;;d;;d;;d;;d
+
+
+# Taken from https://stackoverflow.com/questions/1623039/python-debugging-tips
diff --git a/pdbrc.py b/pdbrc.py
new file mode 100644
index 0000000..b3a8675
--- /dev/null
+++ b/pdbrc.py
@@ -0,0 +1,63 @@
+# import pdb
+#
+#
+# class Config(pdb.DefaultConfig):
+# sticky_by_default = True
+# current_line_color = 93
+# use_pygments = True
+# colorscheme =
+#
+#
+# def _pdbrc_init():
+# # Save history across sessions
+# import readline
+# histfile = ".pdb-pyhist"
+# try:
+# readline.read_history_file(histfile)
+# except IOError:
+# pass
+# import atexit
+# atexit.register(readline.write_history_file, histfile)
+# readline.set_history_length(500)
+#
+#
+# _pdbrc_init()
+# del _pdbrc_init
+
+
+import readline
+import pdb
+
+
+class Config(pdb.DefaultConfig):
+
+ editor = 'e'
+ stdin_paste = 'epaste'
+ filename_color = pdb.Color.lightgray
+ use_terminal256formatter = False
+ sticky_by_default = True
+ #exec_if_unfocused = "play ~/sounds/dialtone.wav 2> /dev/null &"
+
+ 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'),
+ })
+
+ def setup(self, pdb):
+ # make 'l' an alias to 'longlist'
+ Pdb = pdb.__class__
+ Pdb.do_l = Pdb.do_longlist
+ Pdb.do_st = Pdb.do_sticky