5,875
edits
Changes
From Gramps
m
formating
Short: in your code add data to the logger with: log.warning(), log.error(), log.info()...
Start Gramps with the --debug flag: python gramps.py --debug="name_of_the_logger"
profile(self.save, *obj)
Then run GRAMPSGramps, every time you save, the profiler kicks in and prints to command line a report with the time for each function.
So in short: replace the call to a function/method to calling profile with as first parameter the function/method, and other parameters the parameters of the function/method.
winpdb src/gramps.py
[[Image:Winpdb.png|thumb|Winpdb with GRAMPS Gramps loaded]] Now, in File menu, select 'Open Source', and open the source file you want to debug. Now all debug options are possible. Eg, go to a line in the file with the cursor, and click the ''run to line'' button. The debugger will run to that point, and left show you all defined local variables with their value, as well as the stack frame.
Try it!
With GObject introspection, much more can go wrong on a lower level, causing C errors. For these gdb can be used. You should install some debug libraries like libglib2.0-0-dbg, python-gobject-dbg, ... .
Then, you start in a terminal gdb in the directory where gramps.py is stored with