From be29a10fa55379eeee2323c5365e8baa75d246f3 Mon Sep 17 00:00:00 2001 From: Oscar Ibatullin Date: Fri, 30 May 2014 22:49:13 -0700 Subject: [PATCH] fix #4: make the debugger configurable --- PythonBreakpoints.py | 8 +++----- PythonBreakpoints.sublime-settings | 5 ++++- README.md | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/PythonBreakpoints.py b/PythonBreakpoints.py index c5d227d..1009a8f 100644 --- a/PythonBreakpoints.py +++ b/PythonBreakpoints.py @@ -33,13 +33,11 @@ ############# pdb_block = """\ -try: # do not edit! added by PythonBreakpoints - from ipdb import set_trace as _breakpoint -except ImportError: - from pdb import set_trace as _breakpoint +# do not edit! added by PythonBreakpoints +from %s import set_trace as _breakpoint -""" +""" % settings.get('debugger', 'pdb') bp_regex = r"^[\t ]*_breakpoint\(\) # ([a-f0-9]{8})" bp_re = re.compile(bp_regex, re.DOTALL) diff --git a/PythonBreakpoints.sublime-settings b/PythonBreakpoints.sublime-settings index ed1d8db..6912bc4 100644 --- a/PythonBreakpoints.sublime-settings +++ b/PythonBreakpoints.sublime-settings @@ -1,4 +1,7 @@ { + // preferred debugger (pdb, ipdb, pudb,..) - must support set_trace() call + "debugger": "pdb", + // "auto" (read from global settings), or a positive integer "tab_size": "auto", @@ -7,4 +10,4 @@ // auto-save the file on breakpoint toggle "save_on_toggle": false -} \ No newline at end of file +} diff --git a/README.md b/README.md index ee7bfc3..5c50387 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Sublime Text Python Breakpoints =============================== -This is a [Sublime Text](http://www.sublimetext.com) plugin allowing to quickly set Python breakpoints by injecting [i]pdb.set_trace(). +This is a [Sublime Text](http://www.sublimetext.com) plugin allowing to quickly set Python breakpoints by injecting set_trace() call of pdb or other debugger of your choice. ## Features