Don’t know about an API but here is a quick-and-dirty Supertool script that tries to list all active gramplets.
[Gramps SuperTool script file]
version=1
[title]
list_gramplets
[description]
List all active gramplets.
[category]
Dashboard
[initial_statements]
result.set_headers(["View", "Position", "Gramplet"])
def list_gramplets(grampletbar, viewname, position):
for n in range(grampletbar.get_n_pages()):
g = grampletbar.get_nth_page(n)
if hasattr(g, "title"):
result.add_row([viewname, position, g.title])
for g in grampletbar.detached_gramplets:
result.add_row([viewname, "detached", g.title])
for page in uistate.viewmanager.pages:
viewname = page.get_title()
if page.sidebar:
list_gramplets(page.sidebar, viewname, "sidebar")
if page.bottombar:
list_gramplets(page.bottombar, viewname, "bottombar")
if page.top: # DashBoard
if hasattr(page.top, "gramplet_map"):
for title, g in page.top.gramplet_map.items():
if g in page.top.detached_gramplets:
pos = "detached"
else:
pos = "pane"
result.add_row([viewname, pos, g.title])
[statements]
[filter]
[expressions]
[scope]
selected
[unwind_lists]
False
[commit_changes]
False
[summary_only]
True
The result might look something like this:
You can sort the list by clicking the headers so you should be able to find the gramplet if you know its name.
This can be run in any category although it was written for the Dashboard category.
