Skip to content

Commit aaeef8b

Browse files
committed
Rename the val parameter to gramps_id for consistency
1 parent 0055cb9 commit aaeef8b

File tree

3 files changed

+54
-40
lines changed

3 files changed

+54
-40
lines changed

gramps/gen/proxy/living.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ def iter_people(self):
146146
else:
147147
yield person
148148

149-
def get_person_from_gramps_id(self, val):
149+
def get_person_from_gramps_id(self, gramps_id):
150150
"""
151151
Finds a Person in the database from the passed Gramps ID.
152152
If no such Person exists, None is returned.
153153
"""
154-
person = self.db.get_person_from_gramps_id(val)
154+
person = self.db.get_person_from_gramps_id(gramps_id)
155155
if person and self.__is_living(person):
156156
if self.mode == self.MODE_EXCLUDE_ALL:
157157
return None
@@ -160,12 +160,12 @@ def get_person_from_gramps_id(self, val):
160160
else:
161161
return person
162162

163-
def get_family_from_gramps_id(self, val):
163+
def get_family_from_gramps_id(self, gramps_id):
164164
"""
165165
Finds a Family in the database from the passed Gramps ID.
166166
If no such Family exists, None is returned.
167167
"""
168-
family = self.db.get_family_from_gramps_id(val)
168+
family = self.db.get_family_from_gramps_id(gramps_id)
169169
family = self.__remove_living_from_family(family)
170170
return family
171171

gramps/gen/proxy/private.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -168,92 +168,92 @@ def get_note_from_handle(self, handle):
168168
return note
169169
return None
170170

171-
def get_person_from_gramps_id(self, val):
171+
def get_person_from_gramps_id(self, gramps_id):
172172
"""
173173
Finds a Person in the database from the passed Gramps ID.
174174
If no such Person exists, None is returned.
175175
"""
176-
person = self.db.get_person_from_gramps_id(val)
176+
person = self.db.get_person_from_gramps_id(gramps_id)
177177
if person and not person.get_privacy():
178178
return sanitize_person(self.db, person)
179179
return None
180180

181-
def get_family_from_gramps_id(self, val):
181+
def get_family_from_gramps_id(self, gramps_id):
182182
"""
183183
Finds a Family in the database from the passed Gramps ID.
184184
If no such Family exists, None is returned.
185185
"""
186-
family = self.db.get_family_from_gramps_id(val)
186+
family = self.db.get_family_from_gramps_id(gramps_id)
187187
if family and not family.get_privacy():
188188
return sanitize_family(self.db, family)
189189
return None
190190

191-
def get_event_from_gramps_id(self, val):
191+
def get_event_from_gramps_id(self, gramps_id):
192192
"""
193193
Finds an Event in the database from the passed Gramps ID.
194194
If no such Event exists, None is returned.
195195
"""
196-
event = self.db.get_event_from_gramps_id(val)
196+
event = self.db.get_event_from_gramps_id(gramps_id)
197197
if event and not event.get_privacy():
198198
return sanitize_event(self.db, event)
199199
return None
200200

201-
def get_place_from_gramps_id(self, val):
201+
def get_place_from_gramps_id(self, gramps_id):
202202
"""
203203
Finds a Place in the database from the passed Gramps ID.
204204
If no such Place exists, None is returned.
205205
"""
206-
place = self.db.get_place_from_gramps_id(val)
206+
place = self.db.get_place_from_gramps_id(gramps_id)
207207
if place and not place.get_privacy():
208208
return sanitize_place(self.db, place)
209209
return None
210210

211-
def get_source_from_gramps_id(self, val):
211+
def get_source_from_gramps_id(self, gramps_id):
212212
"""
213213
Finds a Source in the database from the passed Gramps ID.
214214
If no such Source exists, None is returned.
215215
"""
216-
source = self.db.get_source_from_gramps_id(val)
216+
source = self.db.get_source_from_gramps_id(gramps_id)
217217
if source and not source.get_privacy():
218218
return sanitize_source(self.db, source)
219219
return None
220220

221-
def get_citation_from_gramps_id(self, val):
221+
def get_citation_from_gramps_id(self, gramps_id):
222222
"""
223223
Finds a Citation in the database from the passed Gramps ID.
224224
If no such Citation exists, None is returned.
225225
"""
226-
citation = self.db.get_citation_from_gramps_id(val)
226+
citation = self.db.get_citation_from_gramps_id(gramps_id)
227227
if citation and not citation.get_privacy():
228228
return sanitize_citation(self.db, citation)
229229
return None
230230

231-
def get_media_from_gramps_id(self, val):
231+
def get_media_from_gramps_id(self, gramps_id):
232232
"""
233233
Finds a Media in the database from the passed Gramps ID.
234234
If no such Media exists, None is returned.
235235
"""
236-
obj = self.db.get_media_from_gramps_id(val)
236+
obj = self.db.get_media_from_gramps_id(gramps_id)
237237
if obj and not obj.get_privacy():
238238
return sanitize_media(self.db, obj)
239239
return None
240240

241-
def get_repository_from_gramps_id(self, val):
241+
def get_repository_from_gramps_id(self, gramps_id):
242242
"""
243243
Finds a Repository in the database from the passed Gramps ID.
244244
If no such Repository exists, None is returned.
245245
"""
246-
repository = self.db.get_repository_from_gramps_id(val)
246+
repository = self.db.get_repository_from_gramps_id(gramps_id)
247247
if repository and not repository.get_privacy():
248248
return sanitize_repository(self.db, repository)
249249
return None
250250

251-
def get_note_from_gramps_id(self, val):
251+
def get_note_from_gramps_id(self, gramps_id):
252252
"""
253253
Finds a Note in the database from the passed Gramps ID.
254254
If no such Note exists, None is returned.
255255
"""
256-
note = self.db.get_note_from_gramps_id(val)
256+
note = self.db.get_note_from_gramps_id(gramps_id)
257257
if note and not note.get_privacy():
258258
return note
259259
return None

gramps/gen/proxy/proxybase.py

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -567,72 +567,86 @@ def get_tag_from_handle(self, handle):
567567
"""
568568
return self.gfilter(self.include_tag, self.db.get_tag_from_handle(handle))
569569

570-
def get_person_from_gramps_id(self, val):
570+
def get_person_from_gramps_id(self, gramps_id):
571571
"""
572572
Finds a Person in the database from the passed Gramps ID.
573573
If no such Person exists, None is returned.
574574
"""
575-
return self.gfilter(self.include_person, self.db.get_person_from_gramps_id(val))
575+
return self.gfilter(
576+
self.include_person, self.db.get_person_from_gramps_id(gramps_id)
577+
)
576578

577-
def get_family_from_gramps_id(self, val):
579+
def get_family_from_gramps_id(self, gramps_id):
578580
"""
579581
Finds a Family in the database from the passed Gramps ID.
580582
If no such Family exists, None is returned.
581583
"""
582-
return self.gfilter(self.include_family, self.db.get_family_from_gramps_id(val))
584+
return self.gfilter(
585+
self.include_family, self.db.get_family_from_gramps_id(gramps_id)
586+
)
583587

584-
def get_event_from_gramps_id(self, val):
588+
def get_event_from_gramps_id(self, gramps_id):
585589
"""
586590
Finds an Event in the database from the passed Gramps ID.
587591
If no such Event exists, None is returned.
588592
"""
589-
return self.gfilter(self.include_event, self.db.get_event_from_gramps_id(val))
593+
return self.gfilter(
594+
self.include_event, self.db.get_event_from_gramps_id(gramps_id)
595+
)
590596

591-
def get_place_from_gramps_id(self, val):
597+
def get_place_from_gramps_id(self, gramps_id):
592598
"""
593599
Finds a Place in the database from the passed gramps' ID.
594600
If no such Place exists, None is returned.
595601
"""
596-
return self.gfilter(self.include_place, self.db.get_place_from_gramps_id(val))
602+
return self.gfilter(
603+
self.include_place, self.db.get_place_from_gramps_id(gramps_id)
604+
)
597605

598-
def get_source_from_gramps_id(self, val):
606+
def get_source_from_gramps_id(self, gramps_id):
599607
"""
600608
Finds a Source in the database from the passed gramps' ID.
601609
If no such Source exists, None is returned.
602610
"""
603-
return self.gfilter(self.include_source, self.db.get_source_from_gramps_id(val))
611+
return self.gfilter(
612+
self.include_source, self.db.get_source_from_gramps_id(gramps_id)
613+
)
604614

605-
def get_citation_from_gramps_id(self, val):
615+
def get_citation_from_gramps_id(self, gramps_id):
606616
"""
607617
Finds a Citation in the database from the passed gramps' ID.
608618
If no such Citation exists, None is returned.
609619
"""
610620
return self.gfilter(
611-
self.include_citation, self.db.get_citation_from_gramps_id(val)
621+
self.include_citation, self.db.get_citation_from_gramps_id(gramps_id)
612622
)
613623

614-
def get_media_from_gramps_id(self, val):
624+
def get_media_from_gramps_id(self, gramps_id):
615625
"""
616626
Finds a Media in the database from the passed gramps' ID.
617627
If no such Media exists, None is returned.
618628
"""
619-
return self.gfilter(self.include_media, self.db.get_media_from_gramps_id(val))
629+
return self.gfilter(
630+
self.include_media, self.db.get_media_from_gramps_id(gramps_id)
631+
)
620632

621-
def get_repository_from_gramps_id(self, val):
633+
def get_repository_from_gramps_id(self, gramps_id):
622634
"""
623635
Finds a Repository in the database from the passed gramps' ID.
624636
If no such Repository exists, None is returned.
625637
"""
626638
return self.gfilter(
627-
self.include_repository, self.db.get_repository_from_gramps_id(val)
639+
self.include_repository, self.db.get_repository_from_gramps_id(gramps_id)
628640
)
629641

630-
def get_note_from_gramps_id(self, val):
642+
def get_note_from_gramps_id(self, gramps_id):
631643
"""
632644
Finds a Note in the database from the passed gramps' ID.
633645
If no such Note exists, None is returned.
634646
"""
635-
return self.gfilter(self.include_note, self.db.get_note_from_gramps_id(val))
647+
return self.gfilter(
648+
self.include_note, self.db.get_note_from_gramps_id(gramps_id)
649+
)
636650

637651
def get_tag_from_name(self, val):
638652
"""

0 commit comments

Comments
 (0)