=== Registered GENERAL Categories ===
The following are examples of the published secondary plugins API's (plugin categories of APIs of type GENERAL, with the following categories):.
==== WEBSTUFF ====
A sample <tt>gpr.py</tt> file:
A sample gpr.py file: <pre> # stylesheet.gpr.py register(GENERAL, id = 'system stylesheets', category = "WEBSTUFF", name = _("CSS Stylesheets"), description = _("Provides a collection of stylesheets for the web"), version = '1.0', gramps_target_version = '6.0', fname = "stylesheet.py", load_on_reg = True, process = "process_list", )</pre>
Here is the associated program:
<pre> # file: stylesheet.py def load_on_reg(dbstate, uistate, plugin): """ Runs when plugin is registered. """ return ["Stylesheet.css", "Another.css"] def process_list(files): return [file.upper() for file in files]</pre>
==== Filters ====
For example, <tt>gpr.py</tt>:
For example: <pre> register(GENERAL, category="Filters", ... load_on_reg = True )</pre> <pre>def load_on_reg(dbstate, uistate, plugin): # returns a function that takes a namespace, 'Person', 'Family', etc.
def filters(namespace)And the actual plugin: print("Ok...", plugin.category, namespace, uistate) # return a Filter object here return filters</pre>
<span id=internationalization> def load_on_reg(dbstate, uistate, plugin): # returns a function that takes a namespace, 'Person', 'Family', etc. def filters(namespace): print("Ok...", plugin.category, namespace, uistate) # return a Filter object here return filters
=== List the Prerequistes your addon depends on ===