The SuperTool has examples of 3 external files being referenced: the configuration
.ini file (in the Plugins folder),
.script files (selected from a GTK file chooser), and a
helptext.txt file which has data for setting a hotlink and tooltip (in the same folder with the Addon). An upcoming release will use
.json instead of
.txt for the helptext file.
Are there better examples of reading external files (using standard parsing libraries) for use/display in plugins?
I've lost track of a number of sample code snippets that would have been nice to use as references. Including examples showing common code-quality evolution that would be useful to Developers learning the Gramps API or Gtk idiosyncrasies. (One is particularly bothersome. I've volunteered intensive beta testing for about a half-dozen developers... and they have been very receptive to feedback. One kindly did a specific quick improvement to their add-on. And even commented the code so the commit could be better used as an example. Now I've lost track of that before finding a good place to link it in the developer tutorials.)
There’s a Useful Snippets subsection in Sphinx (documentation generator) and CMS for the Gramps API. But it is a forlorn section, abandoned with a lonely single entry with a vague “The
Html Class” label, (Linked to a page that is unfortunately lacking any example code snippet.) Unlike the wiki, there is no apparent way for end-users of the documentation contribute new content for the structured Sphinx documentation. (It might also be difficult for developers if the sphinx.ext.doctest extension isn’t active.)
And there are hints about common stumbling blocks in development scatter around the forum too:
- @prculley laments “Ah, the Gramps specific widgets…” in response to @moorob trying to troubleshoot the error message: “
The following required catalogs are unavailable: grampswidgets.”
- And posts about common Gtk related error messages like "
GtkDialog mapped without a transient parent. This is discouraged." with another ‘bug stomping tip’ by @prculley.