Need help getting started with a new addon

Reminder to those helping diagnose…

John’s .py and .gpr.py files can be accessed at:
https://github.com/johnrsibert/addons-source/tree/master/TimelineContingency

The optionclass defined in the gpr file must inherit from MenuReportOptions.

Thanks. Rookie error. Now I have code that at least runs and can be debugged. I’m trying to looks at other reports to get ideas, eg., gvfamilylines.py learn how to select specific people.

Which brings me to another sort of general newbie question. Is there simple example report that could be used as a tutorial and perhaps even a template for writing new reports?

You can explore the code of similar reports. If you search for “Report” in the “Plugin Manager - Enhanced” add-on, you can get “Info” on a Report containing similar data, the dialog will give you the location of the source file.

You can simply clone the Gramps User Directory plugins folder and give them unique registrations. With cloning built-in, you have to put the copy the python file from the built-ins (in Program Files) plugins folder to a new subfolder in the add-ons plugins folder. But the built-in used a combined Gramps Plugin Registration file. So you have to copy just the corresponding registration to a new (and unique) add-on .gpr.py file. Then resolve all the paths.

For finding specific pieces of data, you might explore the code for Custom Filter Rules.

The Complete Individual report may be worth looking at. Taking code from reports with the features you need is a good idea. Ask if you need any further help.

After taking a break for other activities, I’m back to working in my new addon. I’ve shamelessly copied code from gvfamilylines.py. When I try to invoke the Timeline Contingency Report, gramps crashes with this error:
AttributeError: type object ‘TimelineContingency’ has no attribute ‘load_previous_values’
After a lot of futile attempts to find a solution, I’m beginning to wonder if the problem is specifying “category = CATEGORY_TEXT” in the gpr file?

Any help gratefully received. Thanks.

There was an inconsistency with class names in the gpr file. Persons of interest selection now seems to work. I anticipate problems with making the gid list persistent, though.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.