diff --git a/gramps/gen/datehandler/_dateutils.py b/gramps/gen/datehandler/_dateutils.py index 8e38ed2f8..acd3098db 100644 --- a/gramps/gen/datehandler/_dateutils.py +++ b/gramps/gen/datehandler/_dateutils.py @@ -66,7 +66,7 @@ def set_format(value): except: pass -def set_date(date_base, text) : +def set_date(date_base, text): """ Set the date of the :class:`.DateBase` instance. @@ -79,7 +79,7 @@ def set_date(date_base, text) : """ parser.set_date(date_base.get_date_object(), text) -def get_date(date_base) : +def get_date(date_base): """ Return a string representation of the date of the :class:`.DateBase` instance. diff --git a/gramps/gen/filters/rules/event/_matchespersonfilter.py b/gramps/gen/filters/rules/event/_matchespersonfilter.py index 60c9b6b26..3e04cabed 100644 --- a/gramps/gen/filters/rules/event/_matchespersonfilter.py +++ b/gramps/gen/filters/rules/event/_matchespersonfilter.py @@ -81,10 +81,10 @@ class MatchesPersonFilter(MatchesFilterBase): event.get_handle(), ['Family']): family = db.get_family_from_handle(handle) if family.father_handle and filt.check(db, - family.father_handle) : + family.father_handle): return True if family.mother_handle and filt.check(db, - family.mother_handle) : + family.mother_handle): return True return False diff --git a/gramps/gen/filters/rules/place/_hasnolatorlon.py b/gramps/gen/filters/rules/place/_hasnolatorlon.py index 5e8e48531..ba658f4d5 100644 --- a/gramps/gen/filters/rules/place/_hasnolatorlon.py +++ b/gramps/gen/filters/rules/place/_hasnolatorlon.py @@ -50,6 +50,6 @@ class HasNoLatOrLon(Rule): category = _('Position filters') def apply(self,db,place): - if place.get_latitude().strip and place.get_longitude().strip() : + if place.get_latitude().strip and place.get_longitude().strip(): return False return True diff --git a/gramps/gen/filters/rules/place/_inlatlonneighborhood.py b/gramps/gen/filters/rules/place/_inlatlonneighborhood.py index c0889643b..57109d380 100644 --- a/gramps/gen/filters/rules/place/_inlatlonneighborhood.py +++ b/gramps/gen/filters/rules/place/_inlatlonneighborhood.py @@ -153,9 +153,9 @@ class InLatLonNeighborhood(Rule): if self.doublesquares : #two squares to look in : if (lonpl self.E) and \ - (lonpl self.E2) : + (lonpl self.E2): return False - elif (lonpl self.E) : + elif (lonpl self.E): return False return True diff --git a/gramps/gen/utils/maclocale.py b/gramps/gen/utils/maclocale.py index 38ca6c304..af8475685 100644 --- a/gramps/gen/utils/maclocale.py +++ b/gramps/gen/utils/maclocale.py @@ -270,7 +270,7 @@ def mac_setup_localization(glocale): language = translations LOG.debug("Returning Translations %s", ':'.join(translations)) - if not (language and language[0]) : + if not (language and language[0]): if glocale.lang: glocale.language = [glocale.lang[:5]] else: diff --git a/gramps/gui/editors/editprimary.py b/gramps/gui/editors/editprimary.py index 4a8083281..92d17b9e2 100644 --- a/gramps/gui/editors/editprimary.py +++ b/gramps/gui/editors/editprimary.py @@ -278,7 +278,7 @@ class EditPrimary(ManagedWindow, DbGUIElement, metaclass=abc.ABCMeta): self.contexteventbox.connect('button-press-event', self._contextmenu_button_press) - def _contextmenu_button_press(self, obj, event) : + def _contextmenu_button_press(self, obj, event): """ Button press event that is caught when a mousebutton has been pressed while on contexteventbox diff --git a/gramps/gui/plug/export/_exportassistant.py b/gramps/gui/plug/export/_exportassistant.py index 4eb6fe852..16305293d 100644 --- a/gramps/gui/plug/export/_exportassistant.py +++ b/gramps/gui/plug/export/_exportassistant.py @@ -457,7 +457,7 @@ class ExportAssistant(ManagedWindow, Gtk.Assistant): else: #Allow for exotic error: file is still not correct self.check_fileselect(self.chooser, show=False) - if self.get_page_complete(self.chooser) : + if self.get_page_complete(self.chooser): filename = self.chooser.get_filename() name = os.path.split(filename)[1] folder = os.path.split(filename)[0] diff --git a/gramps/gui/widgets/styledtexteditor.py b/gramps/gui/widgets/styledtexteditor.py index 9502184cf..b99d269fa 100644 --- a/gramps/gui/widgets/styledtexteditor.py +++ b/gramps/gui/widgets/styledtexteditor.py @@ -431,7 +431,7 @@ class StyledTextEditor(Gtk.TextView): flavor = self.url_match[MATCH_FLAVOR] url = self.url_match[MATCH_STRING] self._open_url_cb(None, url, flavor) - elif (event.type == Gdk.EventType.BUTTON_PRESS and event.button == 1) : + elif (event.type == Gdk.EventType.BUTTON_PRESS and event.button == 1): #on release we will copy selected data to clipboard self.selclick = True #propagate click diff --git a/gramps/plugins/importer/importxml.py b/gramps/plugins/importer/importxml.py index 133cb65aa..72b200cbe 100644 --- a/gramps/plugins/importer/importxml.py +++ b/gramps/plugins/importer/importxml.py @@ -1751,7 +1751,7 @@ class GrampsParser(UpdateCallback): key = attrs['key'] value = attrs['value'] if type == 'group_as': - if self.db.has_name_group_key(key) : + if self.db.has_name_group_key(key): present = self.db.get_name_group_mapping(key) if not value == present: msg = _('Your Family Tree groups name "%(key)s" together' diff --git a/gramps/plugins/lib/libcairodoc.py b/gramps/plugins/lib/libcairodoc.py index c6b4d1820..adb7b604d 100644 --- a/gramps/plugins/lib/libcairodoc.py +++ b/gramps/plugins/lib/libcairodoc.py @@ -645,7 +645,7 @@ class GtkDocParagraph(GtkDocBaseElement): ## workaround: https://github.com/matasbbb/pitivit/commit/da815339e5ce3631b122a72158ba9ffcc9ee4372 ## OLD EASY CODE: ## oldattrlist = newattrlist.get_iterator() -## while oldattrlist.next() : +## while oldattrlist.next(): ## vals = oldattrlist.get_attrs() ## #print (vals) ## for attr in vals: diff --git a/gramps/plugins/quickview/all_events.py b/gramps/plugins/quickview/all_events.py index 2f5c046e4..297253989 100644 --- a/gramps/plugins/quickview/all_events.py +++ b/gramps/plugins/quickview/all_events.py @@ -90,7 +90,7 @@ def run_fam(database, document, family): # children events event_list_children = [] - for child in sdb.children(family) : + for child in sdb.children(family): #name = sdb.first_name(child) event_list_children += [(child, x) for x in sdb.events(child)] diff --git a/gramps/plugins/quickview/all_relations.py b/gramps/plugins/quickview/all_relations.py index fe5038a0c..ae606b3a8 100644 --- a/gramps/plugins/quickview/all_relations.py +++ b/gramps/plugins/quickview/all_relations.py @@ -290,7 +290,7 @@ class AllRelReport: else: ind1 = 4 ind2 = 5 - for rel,fam in zip(relation[ind1],relation[ind2]) : + for rel,fam in zip(relation[ind1],relation[ind2]): par_str = _('Unknown') #when sibling, parent is unknown if rel == rel_class.REL_MOTHER \ or rel == rel_class.REL_MOTHER_NOTBIRTH: diff --git a/gramps/plugins/quickview/lineage.py b/gramps/plugins/quickview/lineage.py index 728f06a3d..08c0a6f23 100644 --- a/gramps/plugins/quickview/lineage.py +++ b/gramps/plugins/quickview/lineage.py @@ -103,7 +103,7 @@ def run_mother(database, document, person): make_details_child(Person.FEMALE, person, sa, sd, database) -def make_details(gender, person, sa, sd, database, stab) : +def make_details(gender, person, sa, sd, database, stab): """ Function writing one line of ancestry on the document in direct lineage """ @@ -162,11 +162,11 @@ def make_details(gender, person, sa, sd, database, stab) : else : person = None -def make_details_child(gender, person, sa, sd, database) : +def make_details_child(gender, person, sa, sd, database): """ Function that prints the details of the children in the male/female lineage """ - def make_child_line(child, prepend, generation) : + def make_child_line(child, prepend, generation): """ Recursively called function to write one child line Person is the child, prepend is the string that precedes it on print. As the recursion grows, prepend is increased diff --git a/gramps/plugins/rel/rel_ca.py b/gramps/plugins/rel/rel_ca.py index cb917169a..2eb8eb91b 100644 --- a/gramps/plugins/rel/rel_ca.py +++ b/gramps/plugins/rel/rel_ca.py @@ -354,7 +354,7 @@ def _get_mother(level, inlaw="", step=""): taula = _MOTHER_LEVEL_STP nom = "aviastra" - if level < len(taula) : + if level < len(taula): return taula[level] % inlaw # limitation gen = 30 @@ -579,10 +579,10 @@ def _get_uncles(level, inlaw=""): if inlaw != "" and level == 1 : return "els cunyats i les cunyades" - elif level < len(_SIBLINGS_LEVEL) : + elif level < len(_SIBLINGS_LEVEL): return "%s%s" % \ (_SIBLINGS_LEVEL[level], inlaw) - elif level <= len(_LEVEL_NAME_P) : + elif level <= len(_LEVEL_NAME_P): return "els oncles i les ties %s%s" % \ (_LEVEL_NAME_P[level-1], inlaw) else: @@ -690,12 +690,12 @@ def _get_nephews(level, inlaw=""): """ if (inlaw != ""): inlaw += "s" - if level <= len(_NEPHEWS_NIECES_LEVEL) : + if level <= len(_NEPHEWS_NIECES_LEVEL): # limitation gen = 30 return "%s%s" % (_NEPHEWS_NIECES_LEVEL[level-1], inlaw) - elif level <= len(_LEVEL_NAME_P) : + elif level <= len(_LEVEL_NAME_P): return "els nebots i les nebodes %s%s" % \ (_LEVEL_NAME_P[level-1], inlaw) diff --git a/gramps/plugins/tool/notrelated.py b/gramps/plugins/tool/notrelated.py index 2336ce0f3..41f4e79cd 100644 --- a/gramps/plugins/tool/notrelated.py +++ b/gramps/plugins/tool/notrelated.py @@ -64,7 +64,7 @@ WIKI_HELP_SEC = _('manual|Not_Related') # NotRelated class # #------------------------------------------------------------------------ -class NotRelated(tool.ActivePersonTool, ManagedWindow) : +class NotRelated(tool.ActivePersonTool, ManagedWindow): def __init__(self, dbstate, user, options_class, name, callback=None): uistate = user.uistate @@ -184,14 +184,14 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) : self.show() - def iterIsSeparator(self, model, iter) : + def iterIsSeparator(self, model, iter): # return True only if the row is to be treated as a separator if self.model.get_value(iter, 1) == '': # does the row have a GID? return True return False - def selectIsAllowed(self, selection, model, path, isSelected, userData) : + def selectIsAllowed(self, selection, model, path, isSelected, userData): # return True/False depending on if the row being selected is a leaf node iter = self.model.get_iter(path) if self.model.get_value(iter, 1) == '': # does the row have a GID? @@ -199,13 +199,13 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) : return True - def rowSelectionChanged(self, selection) : + def rowSelectionChanged(self, selection): state = selection.count_selected_rows() > 0 self.tagcombo.set_sensitive(state) self.tagapply.set_sensitive(state) - def rowActivated(self, treeView, path, column) : + def rowActivated(self, treeView, path, column): # first we need to check that the row corresponds to a person iter = self.model.get_iter(path) personGid = self.model.get_value(iter, 1) @@ -234,7 +234,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) : display_help(WIKI_HELP_PAGE , WIKI_HELP_SEC) - def applyTagClicked(self, button) : + def applyTagClicked(self, button): progress = None rows = self.treeSelection.count_selected_rows() tag_name = str(self.tagcombo.get_active_text()) @@ -297,7 +297,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) : if progress: progress.close() - def findRelatedPeople(self) : + def findRelatedPeople(self): self.progress.set_pass( # translators: leave all/any {...} untranslated @@ -370,7 +370,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) : self.handlesOfPeopleToBeProcessed.add(childHandle) - def findUnrelatedPeople(self) : + def findUnrelatedPeople(self): # update our numbers self.numberOfRelatedPeople = len(self.handlesOfPeopleAlreadyProcessed) @@ -406,7 +406,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) : self.handlesOfPeopleNotRelated.add(handle) - def populateModel(self) : + def populateModel(self): self.progress.set_pass( # translators: leave all/any {...} untranslated