Skip to content

Commit fd7fdd6

Browse files
Sync addons-source@maintenance/gramps60 with upstream/gramps-project (2026-05-20)
2 parents 73a1808 + 0b65f97 commit fd7fdd6

7 files changed

Lines changed: 36 additions & 10 deletions

File tree

GrampyScript/GrampyScript.gpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
name=_("Gram.py Script"),
2424
description=_("Run a special Gramps Python script"),
2525
status=STABLE,
26-
version = '0.0.2',
26+
version = '0.0.3',
2727
fname="GrampyScript.py",
2828
authors=["Doug Blank"],
2929
authors_email=["doug.blank@gmail.com"],

GrampyScript/datadict2.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def flatten(lst):
4545
result.append(item)
4646
return result
4747

48+
4849
class NoneData:
4950

5051
# def __setattr__(self, attr, value):
@@ -68,6 +69,9 @@ def __call__(self, *args, **kwargs):
6869
# print(args, kwargs)
6970
return ""
7071

72+
def __iter__(self):
73+
return iter([])
74+
7175

7276
class DataDict2(dict):
7377
"""
@@ -234,7 +238,9 @@ def tags(self):
234238
def citations(self):
235239
return DataList2(
236240
[
237-
DataDict2(sa.dbase.get_raw_citation_data(handle), callback=self.callback)
241+
DataDict2(
242+
sa.dbase.get_raw_citation_data(handle), callback=self.callback
243+
)
238244
for handle in self.citation_list
239245
],
240246
)
@@ -252,6 +258,10 @@ def events(self):
252258
],
253259
)
254260

261+
@property
262+
def reference(self):
263+
return DataDict2(sa.dbase.get_raw_person_data(self.ref), callback=self.callback)
264+
255265
@property
256266
def attributes(self):
257267
return self.attribute_list
@@ -268,6 +278,22 @@ def lds_ords(self):
268278
def references(self):
269279
return self.person_ref_list
270280

281+
@property
282+
def back_references(self):
283+
retval = []
284+
for obj_type, ohandle in sa.dbase.find_backlink_handles(self.handle):
285+
obj = sa.dbase.method("get_%s_from_handle", obj_type)(ohandle)
286+
retval.append(DataDict2(obj, callback=self.callback))
287+
return DataList2(retval)
288+
289+
@property
290+
def back_references_recursively(self):
291+
retval = []
292+
for obj_type, ohandle in self._object.get_referenced_handles_recursively():
293+
obj = sa.dbase.method("get_%s_from_handle", obj_type)(ohandle)
294+
retval.append(DataDict2(obj, callback=self.callback))
295+
return DataList2(retval)
296+
271297
@property
272298
def name(self):
273299
if self["_class"] == "Person":

PostgreSQLEnhanced/postgresqlenhanced.gpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"and AI/ML capabilities. For advanced users. "
3434
"Requires PostgreSQL 15+ with extensions. Gramps Web compatible."
3535
),
36-
version = '1.5.2',
36+
version = '1.5.3',
3737
gramps_target_version="6.0",
3838
status=STABLE,
3939
audience=EXPERT, # For advanced users who can configure PostgreSQL

PostgreSQLEnhanced/postgresqlenhanced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import re
4141
import pickle
4242
import sys
43+
import time
4344
from urllib.parse import urlparse, parse_qs
4445

4546
# -------------------------------------------------------------------------
@@ -1958,7 +1959,6 @@ def _set_metadata(self, key, value, use_txn=True):
19581959
pass
19591960

19601961
if attempt < max_retries - 1:
1961-
import time
19621962
time.sleep(0.01 * (2 ** attempt)) # Exponential backoff
19631963
continue
19641964
else:

lxml/etreeGramplet.gpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
description=_("Gramplet for testing etree with Gramps XML"),
1212
status=EXPERIMENTAL,
1313
audience = DEVELOPER,
14-
version = '1.2.2',
14+
version = '1.2.3',
1515
gramps_target_version="6.0",
1616
include_in_listing=True,
1717
height=400,

lxml/lxmlGramplet.gpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
description=_("Gramplet for testing lxml and XSLT"),
1212
status=EXPERIMENTAL,
1313
audience = DEVELOPER,
14-
version = '1.2.2',
14+
version = '1.2.3',
1515
gramps_target_version="6.0",
1616
include_in_listing=True,
1717
height=400,

lxml/lxmlGramplet.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
GZIP_OK = True
7070
except ImportError:
7171
GZIP_OK = False
72-
ErrorDialog(_('Where is gzip?'), _('"gzip" is missing'), parent=self.uistate.window)
72+
ErrorDialog(_('Where is gzip?'), _('"gzip" is missing'))
7373
LOG.error('No gzip')
7474

7575
#-------------------------------------------------------------------------
@@ -91,7 +91,7 @@
9191
LIBXSLT_VERSION = etree.LIBXSLT_VERSION
9292
except ImportError:
9393
LXML_OK = False
94-
ErrorDialog(_('Missing python3 lxml'), _('Please, try to install "python3 lxml" package.'), parent=self.uistate.window)
94+
ErrorDialog(_('Missing python3 lxml'), _('Please, try to install "python3 lxml" package.'))
9595
LOG.debug('No lxml')
9696

9797
#-------------------------------------------------------------------------
@@ -397,7 +397,7 @@ def read_xml(self, entry):
397397
os.system(f'xmllint')
398398

399399
try:
400-
if os.name is 'nt':
400+
if os.name == 'nt':
401401
os.system(f'xmllint --relaxng {rng} --noout {filename} {options}')
402402
LOG.debug('xmllint (relaxng) : %s' % filename)
403403
else:
@@ -755,7 +755,7 @@ def check_valid(self, filename):
755755

756756
dtd = os.path.join(USER_PLUGINS, 'lxml', 'grampsxml.dtd')
757757
try:
758-
if os.name is 'nt':
758+
if os.name == 'nt':
759759
os.system(f'xmllint --dtdvalid {dtd} {filename} {options}')
760760
else:
761761
os.system(f'xmllint --dtdvalid file://{dtd} {filename} {options}')

0 commit comments

Comments
 (0)