[Qgis-developer] pdb and PyQt4 and qgis don't play well with one another

Mark Coletti mcoletti at gmail.com
Tue Oct 21 12:06:16 PDT 2014


So I filed an "issue" <https://github.com/qgis/QGIS-Website/issues/215> for
the qgis web page regarding using pdb with qgis in that the proper imports
weren't done.  However, I've moved forward and found that the code blows up
when I try to drop my python plugin into the debugger.

So this code per the documentation
<http://docs.qgis.org/2.2/en/docs/pyqgis_developer_cookbook/ide_debugging.html#debugging-using-pdb>
:

        pyqtRemoveInputHook()
        pdb.set_trace()

Causes this:

Traceback (most recent call last):
  File
"/Volumes/ColettiData/MarkColettiHome/.qgis2/python/plugins/TweetTracker/tweet_tracker.py",
line 385, in run
    self.__createPointLayer(self.dlg.selectedEventNames(), tweets)
  File
"/Volumes/ColettiData/MarkColettiHome/.qgis2/python/plugins/TweetTracker/tweet_tracker.py",
line 298, in __createPointLayer
    if self.iface.activeLayer() is not None and
self.iface.activeLayer().originalName() is name :
  File
"/Volumes/ColettiData/MarkColettiHome/.qgis2/python/plugins/TweetTracker/tweet_tracker.py",
line 298, in __createPointLayer
    if self.iface.activeLayer() is not None and
self.iface.activeLayer().originalName() is name :
  File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/bdb.py",
line 48, in trace_dispatch
    return self.dispatch_line(frame)
  File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/bdb.py",
line 67, in dispatch_line
    if self.quitting: raise BdbQuit


I'd really rather avoid the annoyance of spraying print statements
everywhere and rely on a proper symbolic debugger.  Surely others are able
to use pdb for their qgis plugins?  If so, how do I make this work?


Cheers!


Mark

-- 
mcoletti at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20141021/59f77653/attachment.html>


More information about the Qgis-developer mailing list