From a31e1162f01a00b11712d64a04315976d30fc2f4 Mon Sep 17 00:00:00 2001 From: Vincent Smeets Date: Sat, 27 Jan 2024 14:48:58 +0100 Subject: [PATCH] Reformat with black --- gramps/gen/utils/db.py | 6 ++-- gramps/plugins/webreport/basepage.py | 42 ++++++++++++++++++---------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/gramps/gen/utils/db.py b/gramps/gen/utils/db.py index 302006dc051..bdaa34b2565 100644 --- a/gramps/gen/utils/db.py +++ b/gramps/gen/utils/db.py @@ -671,11 +671,12 @@ def get_event_person_referents(event_handle, db): This function finds all primary objects that refer to the given event handle in a given database. """ - _primaries = ("Person", ) + _primaries = ("Person",) lists = get_referents(event_handle, db, _primaries) return [x for xs in lists for x in xs] + def get_event_family_referents(event_handle, db): """ Find families that refer to the event object. @@ -683,11 +684,12 @@ def get_event_family_referents(event_handle, db): This function finds all primary objects that refer to the given event handle in a given database. """ - _primaries = ("Family", ) + _primaries = ("Family",) lists = get_referents(event_handle, db, _primaries) return [x for xs in lists for x in xs] + def get_media_referents(media_handle, db): """ Find objects that refer the media object. diff --git a/gramps/plugins/webreport/basepage.py b/gramps/plugins/webreport/basepage.py index 19f9445686c..3b1c42d9f03 100644 --- a/gramps/plugins/webreport/basepage.py +++ b/gramps/plugins/webreport/basepage.py @@ -847,7 +847,9 @@ def event_header_row(self): trow += Html("/tr", close=None) return trow - def display_event_other_person_role(self, skip_event_ref, uplink, htmllist, refering_person): + def display_event_other_person_role( + self, skip_event_ref, uplink, htmllist, refering_person + ): """ Display the role of the refering person to this event. Skip the role for the specified skip_event_ref because it is already @@ -861,7 +863,10 @@ def display_event_other_person_role(self, skip_event_ref, uplink, htmllist, refe """ event_refs = refering_person.get_event_ref_list() for event_ref in event_refs: - if event_ref.get_reference_handle() != skip_event_ref.get_reference_handle(): + if ( + event_ref.get_reference_handle() + != skip_event_ref.get_reference_handle() + ): # Refering to an other event. continue elif event_ref.is_equal(skip_event_ref): @@ -878,9 +883,7 @@ def display_event_other_person_role(self, skip_event_ref, uplink, htmllist, refe "p", _("(%(str1)s) %(str2)s") % { - "str1": Html( - "b", role - ), + "str1": Html("b", role), "str2": person_name, }, ) @@ -900,14 +903,20 @@ def display_event_other_person_roles(self, event, skip_event_ref, uplink, htmlli @return void """ - refering_person_handles = get_event_person_referents(event.get_handle(), self.r_db) + refering_person_handles = get_event_person_referents( + event.get_handle(), self.r_db + ) for refering_person_handle in refering_person_handles: refering_person = self.r_db.get_person_from_handle(refering_person_handle) if not refering_person: continue - self.display_event_other_person_role(skip_event_ref, uplink, htmllist, refering_person) + self.display_event_other_person_role( + skip_event_ref, uplink, htmllist, refering_person + ) - def display_event_other_family_role(self, skip_event_ref, uplink, htmllist, refering_family): + def display_event_other_family_role( + self, skip_event_ref, uplink, htmllist, refering_family + ): """ Display the role of the refering family to this event. Skip the role for the specified skip_event_ref because it is already @@ -921,7 +930,10 @@ def display_event_other_family_role(self, skip_event_ref, uplink, htmllist, refe """ event_refs = refering_family.get_event_ref_list() for event_ref in event_refs: - if event_ref.get_reference_handle() != skip_event_ref.get_reference_handle(): + if ( + event_ref.get_reference_handle() + != skip_event_ref.get_reference_handle() + ): # Refering to an other event. continue elif event_ref.is_equal(skip_event_ref): @@ -941,9 +953,7 @@ def display_event_other_family_role(self, skip_event_ref, uplink, htmllist, refe "p", _("(%(str1)s) %(str2)s") % { - "str1": Html( - "b", role - ), + "str1": Html("b", role), "str2": family_name, }, ) @@ -963,12 +973,16 @@ def display_event_other_family_roles(self, event, skip_event_ref, uplink, htmlli @return void """ - refering_family_handles = get_event_family_referents(event.get_handle(), self.r_db) + refering_family_handles = get_event_family_referents( + event.get_handle(), self.r_db + ) for refering_family_handle in refering_family_handles: refering_family = self.r_db.get_family_from_handle(refering_family_handle) if not refering_family: continue - self.display_event_other_family_role(skip_event_ref, uplink, htmllist, refering_family) + self.display_event_other_family_role( + skip_event_ref, uplink, htmllist, refering_family + ) def display_event_row( self, event, event_ref, place_lat_long, uplink, hyperlink, omit