Gramps-webapi: Specifying a family for family_descend_chart

I have been trying to generate a “family_descend_chart” report in the Gramps webapi.
I had trouble specifying which family to report on.
I tried: “pid”: “F0098” and got ERROR 422: UNPROCESSABLE ENTITY.
Looking into the code (reports.py), I found that option values are checked for validity against the command’s help text. In the case of “pid” (which probably ought to be “fid”; copy/paste error?), each of the valid values identifies a specific family as ID colon tab family-name; e.g. “F0137:\tDoe, John, Smith, Jane”
Having tried using that as the “pid” value (which didn’t work), I looked further and found that the help values are split at the tab, with only the part before the tab being used.
So I tried “F0098:” that is with a colon after the ID.
That successfully passed validation, but failed later on because, of course, there was no family with an ID of “F0098:”.

I tried changing the split on tab to a split on “:\t”, but of course that broke other options which don’t have a colon.
I worked round this by adding "rstrip(‘:’) to the split-on-tab result. That worked!

A simpler way would be not to use a colon in the help text, but I haven’t been able to find where that text is generated.

  1. Can you point me at where the help text is generated? Would you consider not using the colon?

  2. An alternative is my work-round, but that would affect any options whose values can legitimately end in a colon. Thoughts?

The Discourse forum content has grown enough that it might be beneficial to invite a Subject Matter Expert’s attention in a 1st posting. Otherwise, that person might overlook it.

The Discourse forum has become a good place for general queries. But queries that are already isolated to a specific add-on (like this one by @DavidMStraub ) might get more personal attention if posted as an ‘issue’ in the GitHub repository for the addon.

If the subject of the query needs a broad cross-section of viewpoints discussed, this is also the right forum.

Another alternative night be to continue use the developer maillist for such technical discussions. It appears that there are serious Gramps developers subscribed to that maillist who do not frequent this forum.

Another consideration (that should not be allowed to become an inflexible constraint) is that a surfeit of programmer content could intimidate new users and drive them away. Those users have a more desperate need for this forum’s ability to include illustrative screen captures and hotlinks on the fly. (Such illustrations & links for developers ought to enrich the README.md files and Sphinx docs. Since the developers obviously have rights to do such documentation improvements)

Thanks @emyoulation
I’ve raised this as an issue in github.

1 Like

Don’t forget to “watch” that GitHub repository too.

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