-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Mastering QGIS - Second Edition
By :
Here, we will show how to debug the TestPlugin remotely. We'll also learn how to insert a code breakpoint, stop executions, and show variable values during executions. The steps to follow are:
Create a PyDev project that points to the source code of the TestPlugin.
Add a breakpoint to the TestPlugin run() function in the Aptana Debug perspective.
Start the PyDev Debug server.
Connect to the PyDev server from QGIS.
Run the plugin.
Explore the variable values.
Continue the execution of the plugin.
To be able to add code breakpoints, it's necessary to load test_plugin.py. This can be simply opened as a file, but it's better to learn how to view the entire plugin as a PyDev project. This allows us to use Aptana as a debug and develop environment. This is done in two steps:
Create a PyDev project in Aptana Studio 3.
Link the source code to the project.
Creating a PyDev project called TestPlugin is done by navigating to File | New Project....
Change the font size
Change margin width
Change background colour