In reply to this post by GRAMPS - User mailing list
Wow, Paul! You've given us a way to build custom filter rules!
That's worth some time exploring. Thanks for the sample. Think I'll take this slow as a Python learning exercise using the example.gramps tree. (Hopefully to follow up with a manual section. It would be good if you don't have to answer the same question again next year.)
In the meantime, I expanded a backup file and tweaked it with Notepad++. (This facilitated cleaning out all the other accidental customizations... such as where Suffix entries were typed into surname Origin fields. And spelling inconsistencies were easier to comprehensively correct that way too.)
I did experience 3 failure cycles importing the expanded & edited .gramps backup file. For some reason, several HTML entities ( & and > ) were corrupted with the semicolons being incorrectly converted to colons. Fortunately, the Gramps import status dialog identified the line and column and that made it easy to find the errors & fix. Once the import completed without a warning, I deleted the tree & imported into a new, blank tree.
With this process, I was able find and clean out ALL those distracting extra menu items. Considering the file had over 685,000 lines, it was more time effective than editing record-by-record.
On Fri, 10/26/18, Paul Culley <[hidden email]> wrote:
You might be able to do something with information from this thread
Unfortunately, I have not yet been able to figure out how to do a filter rule via an addon. I actually made one once, only to find out that Gramps processes the custom filter settings file before it adds the addons. As a result, errors are produced when the new addon rule is not found (because it had not been loaded yet). And the custom filter using the rule would be lost. The user would have to remake his filter settings every time he wanted to use the rule. Not friendly...
I'll have to see if the standard Gramps code can be modified to allow filter rules via addons.