Permalink
Browse files

added _input_debug_cmd (aka the debug console)

  • Loading branch information...
1 parent 4495bbc commit 67c0f31e89fa1d11a2d374cd0acbda965be60688 @devhawk committed Mar 27, 2009
Showing with 21 additions and 0 deletions.
  1. +21 −0 ipydbg.py
View
@@ -312,6 +312,27 @@ def _print_source_line(self, sp, lines):
_inputcmds = dict()
+ @inputcmd(_inputcmds, ConsoleKey.D)
+ def _input_debug_cmd(self, keyinfo):
+ print
+ with CC.ConsoleColorMgr(ConsoleColor.DarkBlue, ConsoleColor.White):
+ print "Debug Mode"
+ cmd = ""
+ while True:
+ Console.Write(">>>")
+ line = Console.ReadLine()
+ if str.IsNullOrEmpty(line):
+ if str.IsNullOrEmpty(cmd):
+ break
+ else:
+ code = compile(cmd, "<input>", "single")
+ print "Executing:"+ cmd
+ exec code in globals(), {'self': self}
+ cmd = ""
+ else:
+ cmd = cmd + line
+ if cmd != line: cmd = cmd + "\n"
+
@inputcmd(_inputcmds, ConsoleKey.Spacebar)
def _input_continue_cmd(self, keyinfo):
print "\nContinuing"

0 comments on commit 67c0f31

Please sign in to comment.