Modified whatsnext gramplet to ignore tagged events - possible to include in future version?

Windows 10, Gramps ver 5.1.4

The whatsnext gramplet makes use of tags to indicate when a person is complete, a family is complete and a tag to cause the gramplet to ignore a person or family and produce a list of tasks that need doing. Very handy indeed!

I found that there were instances where I wanted to continue to process a person, but still wanted to exclude certain events that I knew could not be updated further: events such as a divorce with a partial date would still appear in the what’s next list even though the family was tagged as complete.

I made an earlier post to the mailing lists asking if it were possible to modify the whatsnext gramplet so it would ignore individual events that were tagged with the ignore tag - such as the divorce events indicated above.

I spent some time learning python and this is what I came up with to modify the function that process the events in this gramplet. I have tested it on my system and it functions as I expected - removing events from the list that are tagged with the ignore tag.

The three lines of code immediately after the function definition are what I added to the whatsnext.py file

def __process_event(self, event):

    **if self.__ignore_handle is not None and \**

** self.__ignore_handle in event.get_tag_list():**
** return []**

    missingbits = []

    date = event.get_date_object()
    if date.is_empty():
        missingbits.append(_("date unknown"))
    elif not date.is_regular():
        missingbits.append(_("date incomplete"))

    place_handle = event.get_place_handle()
    if not place_handle:
        missingbits.append(_("place unknown"))

    if missingbits:
        # translators: needed for French, ignore otherwise
        return [_("%(str1)s: %(str2)s"
                 ) % {'str1' : event.get_type(),
                      'str2' : _(", ").join(missingbits)}] # Arabic OK
    else:
        return []
2 Likes

Don’t see why not, if possible please raise a feature request and include details and a copy of the patched file, so that one of the developers can look or assign it to themselves and it can be tested and tracked etc…

Also suggest including links to the previous discussions from here.

What’s Next is one of the built-in Gramplets. So any submitted enhancement wouldn’t be released until 5.2 version… many months away.

How about renaming the gramplet & converting it to a 3rd party add-on? Updates would not be restricted to ANY release schedule. It could evolve much more quickly that way.

That is an interesting proposal.

A bit daunting, but interesting.

I will have to look into what is involved.

Cheers!

Geoff

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