Skip to content

Commit bb6540a

Browse files
committed
Correctly decorate static methods with @staticmethod
1 parent d64da69 commit bb6540a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

Form/UK1841.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def get_actions(dbstate, citation, form_event):
6565
return actions
6666

6767
class PrimaryNameCitation:
68+
@staticmethod
6869
def get_actions(dbstate, citation, form_event):
6970
db = dbstate.db
7071
actions = []
@@ -73,6 +74,7 @@ def get_actions(dbstate, citation, form_event):
7374
lambda dbstate, uistate, track, citation_handle = citation.handle, person_handle = person.handle: PrimaryNameCitation.command(dbstate, uistate, track, citation_handle, person_handle)))
7475
return (_("Add Primary Name citation"), actions)
7576

77+
@staticmethod
7678
def command(dbstate, uistate, track, citation_handle, person_handle):
7779
db = dbstate.db
7880
person = db.get_person_from_handle(person_handle)
@@ -81,6 +83,7 @@ def command(dbstate, uistate, track, citation_handle, person_handle):
8183
db.commit_person(person, trans)
8284

8385
class AlternateName:
86+
@staticmethod
8487
def get_actions(dbstate, citation, form_event):
8588
db = dbstate.db
8689
actions = []
@@ -92,6 +95,7 @@ def get_actions(dbstate, citation, form_event):
9295
lambda dbstate, uistate, track, person_handle = person.handle, alternate_ = alternate: AlternateName.command(dbstate, uistate, track, person_handle, alternate_)))
9396
return (_("Add alternate name"), actions)
9497

98+
@staticmethod
9599
def command(dbstate, uistate, track, person_handle, alternate):
96100
db = dbstate.db
97101
person = db.get_person_from_handle(person_handle)
@@ -100,6 +104,7 @@ def command(dbstate, uistate, track, person_handle, alternate):
100104
db.commit_person(person, trans)
101105

102106
class BirthEvent:
107+
@staticmethod
103108
def get_actions(dbstate, citation, form_event):
104109
db = dbstate.db
105110
actions = []
@@ -129,6 +134,7 @@ def get_actions(dbstate, citation, form_event):
129134
return (_("Add Birth event"), actions)
130135

131136
class OccupationEvent:
137+
@staticmethod
132138
def get_actions(dbstate, citation, form_event):
133139
db = dbstate.db
134140
actions = []
@@ -140,6 +146,7 @@ def get_actions(dbstate, citation, form_event):
140146
return (_("Add Occupation event"), actions)
141147

142148
class ResidenceEvent:
149+
@staticmethod
143150
def get_actions(dbstate, citation, form_event):
144151
db = dbstate.db
145152
# build a list of all the people referenced in the form. For 1841, all people have a PRIMARY event role
@@ -159,6 +166,7 @@ def get_actions(dbstate, citation, form_event):
159166
lambda dbstate, uistate, track, citation_handle = citation.handle, people_handles = people: ResidenceEvent.command(dbstate, uistate, track, citation_handle, form_event.get_date_object(), form_event.get_place_handle(), people_handles)))
160167
return (_("Add Residence event"), actions)
161168

169+
@staticmethod
162170
def command(dbstate, uistate, track, citation_handle, event_date_object, event_place_handle, people_handles):
163171
db = dbstate.db
164172
# create the RESIDENCE event

Form/actionbase.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class ActionBase():
5252
def __init__(self):
5353
pass
5454

55+
@staticmethod
5556
def add_event_to_person(dbstate, uistate, track, person_handle, event_type, event_date_object, event_description, citation_handle, event_role_type):
5657
db = dbstate.db
5758
"""
@@ -75,6 +76,7 @@ def add_event_to_person(dbstate, uistate, track, person_handle, event_type, even
7576
with DbTxn(_("Add Event (%s)") % name_displayer.display(person), db) as trans:
7677
db.commit_person(person, trans)
7778

79+
@staticmethod
7880
def get_form_person_attr(db, form_event_handle, attr_type):
7981
"""
8082
Find all persons referencing the form_event and which have an attribute of type attr_type

Form/formactions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def on_action_toggled(self, widget, path):
190190
self.model[parent][self.RUN_INCONSISTENT_COL] = not consistent
191191
self.model[parent][self.RUN_ACTION_COL] = consistent and value
192192

193+
@staticmethod
193194
def all_children_consistent(model, parent, col):
194195
consistent = True
195196
value = False

0 commit comments

Comments
 (0)