Skip to content

Commit e84b26d

Browse files
committed
Merge branch 'gramps52'
2 parents d7b5fd9 + e7e0728 commit e84b26d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+59549
-21997
lines changed

ChangeLog

+396-81
Large diffs are not rendered by default.

NEWS

+47
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,50 @@
1+
2024-07-13
2+
Version 5.2.3
3+
* Updated translations: da, de_AT, en_GB, es, fr, he, hr, hu, mk, nb, nl, pt_PT,
4+
ru, tr, zh_HK, zh_TW.
5+
* Fix bug with regular expressions in check_po script.
6+
* Update translation template for new release.
7+
* Corrected terminology. Replaced "matronymic" with "matrilineal" to accurately
8+
reflect genetic inheritance rather than naming conventions.
9+
* Clarified terminology for father lineage description. Changed
10+
"patronymic lineage" to "patrilineal lineage" for accuracy.
11+
* Fix PDF generation failure with LaTeX-based reports on Windows. Fixes #10696.
12+
* Fix fallback for the `image_size` utility function Use Gdk if the size of the
13+
image cannot be determined by imagesize. Fixes #13310.
14+
* Disable rounding glyph positions in cairo document generator.
15+
* Package Gramps 5.2.3 for macOS.
16+
* Fix NoteType values in CSV import.
17+
* Some short french month names can not be entered. Fixes #13307.
18+
* Remove detached process flag when running lualatex.
19+
* Check that pdf output file exists in genealogy tree reports. Fixes #10696.
20+
* Fix error when changing the style of misspelt words. In the note editor,
21+
changing the style of text failing the spell check caused an error.
22+
Fixes #13282.
23+
* Update span characters for zh_TW. Add span characters so that the new display
24+
format is accepted as a valid input format.
25+
* Restore BerkelyDB, Gramps still uses it.
26+
* Update gramps.modules.
27+
* Remove obsolete comment and comment out the private include.
28+
* Update the branch in gramps-git.
29+
* Remove BerkeleyDB and pybsddb dependencies.
30+
* Remove unused patches.
31+
* Fix missing media in narrative web report person pages. Fixes #13252, #13272.
32+
* Remove the spaces padding the connector in a hyphenated surname. This fixes
33+
the previous code which replaced " - " with "-" within the entire name.
34+
Fixes #13274.
35+
* Url-quote norm_path and use urljoin to attach the scheme. Assumes that if
36+
the path is already a URI it is also already quoted. Fixes #13218, #13197.
37+
* Prevent hyperlink tagging being added as an undo action. Clicking the undo
38+
button in the note editor sometimes had no noticeable effect. Fixes #13267.
39+
* Change repository "Title" to "Name" in the source editor. Fixes #13258.
40+
* Better error handling in the narrative web report.
41+
* Handle not found when creating the narrative web report updates page.
42+
Fixes #13216.
43+
* Add workflow for Debian build.
44+
* Package Gramps 5.2.2 for macOS.
45+
* Use README.md for PyPI long description.
46+
* Fix Windows AIO build.
47+
148
2024-04-06
249
Version 5.2.2
350
* Updated translations: cs, de, de_AT, es, fi, he, hr, nb, nl, pl, ru, sk, sv,

aio/build.sh

+7-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ pacman -S --needed --noconfirm \
4141
upx
4242
pacman -S --needed --noconfirm mingw-w64-x86_64-toolchain
4343

44-
wget -N https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
44+
wget --no-verbose -N https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-cx-freeze-6.15.9-1-any.pkg.tar.zst
45+
pacman -U --needed --noconfirm mingw-w64-x86_64-python-cx-freeze-6.15.9-1-any.pkg.tar.zst
46+
47+
wget --no-verbose -N https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
4548
pacman -U --needed --noconfirm mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
4649

4750
pacman -S --needed --noconfirm mingw-w64-x86_64-python-bsddb3
@@ -92,16 +95,16 @@ dicts=(
9295
for dict in "${dicts[@]}"; do
9396
dir=${dict%:*}
9497
lang=${dict#*:}
95-
wget ${rootdir}${dir}/index.aff
98+
wget --no-verbose ${rootdir}${dir}/index.aff
9699
mv index.aff ${lang}.aff
97-
wget ${rootdir}${dir}/index.dic
100+
wget --no-verbose ${rootdir}${dir}/index.dic
98101
mv index.dic ${lang}.dic
99102
done
100103
popd
101104

102105
mkdir -p /mingw64/share/enchant/voikko
103106
pushd /mingw64/share/enchant/voikko
104-
wget -N https://www.puimula.org/htp/testing/voikko-snapshot-v5/dict.zip
107+
wget --no-verbose -N https://www.puimula.org/htp/testing/voikko-snapshot-v5/dict.zip
105108
unzip -o dict.zip
106109
rm dict.zip
107110
popd

data/org.gramps_project.Gramps.metainfo.xml.in

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
<content_rating type="oars-1.1" />
5959

6060
<releases>
61+
<release date="2024-07-13" version="5.2.3" />
6162
<release date="2024-04-06" version="5.2.2" />
6263
<release date="2024-03-24" version="5.2.1" />
6364
<release date="2024-02-23" version="5.2.0" />

gramps/gen/datehandler/_date_fr.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ class DateParserFR(DateParser):
5656
converted, the text string is assigned.
5757
"""
5858

59-
month_to_int = DateParser.month_to_int
60-
6159
modifier_to_int = {
6260
"avant": Date.MOD_BEFORE,
6361
"av.": Date.MOD_BEFORE,
@@ -110,8 +108,6 @@ def init_strings(self):
110108
can be coded after DateParser.init_strings(self) call, that way they
111109
override stuff from this method. See DateParserRU() as an example.
112110
"""
113-
DateParser.init_strings(self)
114-
115111
DateParser.calendar_to_int.update(
116112
{
117113
"révolutionnaire": Date.CAL_FRENCH,
@@ -189,6 +185,8 @@ def init_strings(self):
189185
}
190186
)
191187

188+
DateParser.init_strings(self)
189+
192190
# This self._numeric is different from the base
193191
# avoid bug gregorian / french calendar conversion (+/-10 days)
194192

gramps/gen/datehandler/_date_zh_TW.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ def init_strings(self):
123123
This method compiles regular expression strings for matching dates.
124124
"""
125125
DateParser.init_strings(self)
126-
_span_1 = ["自"]
127-
_span_2 = ["至"]
126+
_span_1 = ["自", "從"]
127+
_span_2 = ["至", "到"]
128128
_range_1 = ["介於"]
129129
_range_2 = ["與"]
130130
_range_3 = ["之間"]

gramps/gen/display/name.py

+25-32
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,8 @@ def _raw_full_surname(raw_surn_data_list):
161161
"""method for the 'l' symbol: full surnames"""
162162
result = ""
163163
for raw_surn_data in raw_surn_data_list:
164-
result += "%s %s %s " % (
165-
raw_surn_data[_PREFIX_IN_LIST],
166-
raw_surn_data[_SURNAME_IN_LIST],
167-
raw_surn_data[_CONNECTOR_IN_LIST],
168-
)
169-
return " ".join(result.split()).strip()
164+
result += __format_raw_surname(raw_surn_data)
165+
return result.strip()
170166

171167

172168
def _raw_primary_surname(raw_surn_data_list):
@@ -189,12 +185,7 @@ def _raw_primary_surname(raw_surn_data_list):
189185
):
190186
return ""
191187
else:
192-
result = "%s %s %s" % (
193-
raw_surn_data[_PREFIX_IN_LIST],
194-
raw_surn_data[_SURNAME_IN_LIST],
195-
raw_surn_data[_CONNECTOR_IN_LIST],
196-
)
197-
return " ".join(result.split())
188+
return __format_raw_surname(raw_surn_data).strip()
198189
return ""
199190

200191

@@ -265,12 +256,7 @@ def _raw_patro_surname(raw_surn_data_list):
265256
raw_surn_data[_TYPE_IN_LIST][0] == _ORIGINPATRO
266257
or raw_surn_data[_TYPE_IN_LIST][0] == _ORIGINMATRO
267258
):
268-
result = "%s %s %s" % (
269-
raw_surn_data[_PREFIX_IN_LIST],
270-
raw_surn_data[_SURNAME_IN_LIST],
271-
raw_surn_data[_CONNECTOR_IN_LIST],
272-
)
273-
return " ".join(result.split())
259+
return __format_raw_surname(raw_surn_data).strip()
274260
return ""
275261

276262

@@ -321,26 +307,17 @@ def _raw_nonpatro_surname(raw_surn_data_list):
321307
and raw_surn_data[_TYPE_IN_LIST][0] != _ORIGINPATRO
322308
and raw_surn_data[_TYPE_IN_LIST][0] != _ORIGINMATRO
323309
):
324-
result += "%s %s %s " % (
325-
raw_surn_data[_PREFIX_IN_LIST],
326-
raw_surn_data[_SURNAME_IN_LIST],
327-
raw_surn_data[_CONNECTOR_IN_LIST],
328-
)
329-
return " ".join(result.split()).strip()
310+
result += __format_raw_surname(raw_surn_data)
311+
return result.strip()
330312

331313

332314
def _raw_nonprimary_surname(raw_surn_data_list):
333315
"""method for the 'r' symbol: nonprimary surnames"""
334316
result = ""
335317
for raw_surn_data in raw_surn_data_list:
336318
if not raw_surn_data[_PRIMARY_IN_LIST]:
337-
result = "%s %s %s %s" % (
338-
result,
339-
raw_surn_data[_PREFIX_IN_LIST],
340-
raw_surn_data[_SURNAME_IN_LIST],
341-
raw_surn_data[_CONNECTOR_IN_LIST],
342-
)
343-
return " ".join(result.split())
319+
result += __format_raw_surname(raw_surn_data)
320+
return result.strip()
344321

345322

346323
def _raw_prefix_surname(raw_surn_data_list):
@@ -373,7 +350,23 @@ def cleanup_name(namestring):
373350
else:
374351
result += " " + val
375352

376-
result = result.replace(" - ", "-")
353+
return result
354+
355+
356+
def __format_raw_surname(raw_surn_data):
357+
"""
358+
Return a formatted string representing one surname part.
359+
360+
If the connector is a hyphen, don't pad it with spaces.
361+
"""
362+
result = raw_surn_data[_PREFIX_IN_LIST]
363+
if result:
364+
result += " "
365+
result += raw_surn_data[_SURNAME_IN_LIST]
366+
if result and raw_surn_data[_CONNECTOR_IN_LIST] != "-":
367+
result += " %s " % raw_surn_data[_CONNECTOR_IN_LIST]
368+
else:
369+
result += raw_surn_data[_CONNECTOR_IN_LIST]
377370
return result
378371

379372

gramps/gen/plug/docgen/treedoc.py

+14-5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
from ..menu import NumberOption, TextOption, EnumeratedListOption
4646
from ...constfunc import win
4747
from ...config import config
48+
from ...errors import ReportError
4849
from ...const import GRAMPS_LOCALE as glocale
4950

5051
_ = glocale.translation.gettext
@@ -130,7 +131,7 @@
130131

131132
if win():
132133
_LATEX_FOUND = search_for("lualatex.exe")
133-
DETACHED_PROCESS = 8
134+
CREATE_NO_WINDOW = 0x8000000
134135
else:
135136
_LATEX_FOUND = search_for("lualatex")
136137

@@ -803,19 +804,27 @@ def close(self):
803804

804805
with tempfile.TemporaryDirectory() as tmpdir:
805806
basename = os.path.basename(self._filename)
806-
args = ["lualatex", "-output-directory", tmpdir, "-jobname", basename[:-4]]
807+
args = ["lualatex", "--jobname", basename[:-4]]
807808
if win():
808809
proc = Popen(
809810
args,
810811
stdin=PIPE,
811812
stdout=PIPE,
812813
stderr=PIPE,
813-
creationflags=DETACHED_PROCESS,
814+
cwd=tmpdir,
815+
creationflags=CREATE_NO_WINDOW,
814816
)
815817
else:
816-
proc = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
818+
proc = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, cwd=tmpdir)
817819
proc.communicate(input=self._tex.getvalue().encode("utf-8"))
818-
shutil.copy(os.path.join(tmpdir, basename), self._filename)
820+
821+
temp_output_file = os.path.join(tmpdir, basename)
822+
if os.path.isfile(temp_output_file):
823+
shutil.copy(temp_output_file, self._filename)
824+
else:
825+
raise ReportError(
826+
_("Empty report"), _("Could not create %s") % self._filename
827+
)
819828

820829

821830
# ------------------------------------------------------------------------------

gramps/gen/utils/image.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ def image_size(source):
186186
import imagesize
187187

188188
return imagesize.get(source)
189-
except (ImportError, FileNotFoundError):
190-
# python-imagesize is not installed or the file does not exist.
189+
except (ImportError, FileNotFoundError, ValueError):
190+
# python-imagesize is not installed, the file does not exist, or
191+
# the size cannot be determined by imagesize.
191192
# So Trying to get image size with Gdk.
192193
try:
193194
img = GdkPixbuf.Pixbuf.new_from_file(source)

gramps/gui/aboutdialog.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ def get_versions(self):
194194
class AuthorParser(handler.ContentHandler):
195195
"""Parse the ``authors.xml`` file to show in the About dialog.
196196
197-
The ``authors.xml`` file has the same format as the one in the `svn2cl
198-
<http://ch.tudelft.nl/~arthur/svn2cl/>`_ package, with an additional
199-
``title`` tag in the ``author`` element. For example::
197+
The ``authors.xml`` file has the same format as the one in the `svn2cl`
198+
package, with an additional ``title`` tag in the ``author`` element.
199+
For example::
200200
201201
<author uid="dallingham" title="author">
202202
Don Allingham &lt;<html:a href="mailto:[email protected]">[email protected]</html:a>&gt;

gramps/gui/editors/displaytabs/repoembedlist.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class RepoEmbedList(EmbeddedList, DbGUIElement):
6565
# (name, sortcol in model, width, markup/text, weigth_col
6666
_column_names = [
6767
(_("ID"), 0, 75, TEXT_COL, -1, None),
68-
(_("Title"), 1, 200, TEXT_COL, -1, None),
68+
(_("Name"), 1, 200, TEXT_COL, -1, None),
6969
(_("Call Number"), 2, 125, TEXT_COL, -1, None),
7070
(_("Type"), 3, 100, TEXT_COL, -1, None),
7171
(_("Private"), 4, 30, ICON_COL, -1, "gramps-lock"),

gramps/gui/utils.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import os
3131
import sys
3232
import threading
33+
from urllib.parse import urljoin, quote as urlquote
3334

3435
# gtk is not included here, because this file is currently imported
3536
# by code that needs to run without the DISPLAY variable (eg, in
@@ -506,7 +507,8 @@ def open_file_with_default_application(path, uistate):
506507
return
507508

508509
if not norm_path.startswith("file://"):
509-
norm_path = "file://" + norm_path
510+
norm_path = urljoin("file://", urlquote(norm_path))
511+
510512
try:
511513
Gio.AppInfo.launch_default_for_uri(norm_path)
512514
except GLib.Error as error:

gramps/gui/widgets/styledtextbuffer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def _remove_style_from_selection(self, style):
492492
start, end = self._get_selection()
493493
tags = self._get_tag_from_range(start.get_offset(), end.get_offset())
494494
for tag_name, tag_data in tags.items():
495-
if tag_name.startswith(str(style)):
495+
if tag_name is not None and tag_name.startswith(str(style)):
496496
for start, end in tag_data:
497497
self.remove_tag_by_name(
498498
tag_name,

gramps/gui/widgets/undoablestyledbuffer.py

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ def undo_disabled(self):
112112
self.not_undoable_action = oldflag
113113

114114
def on_tag_insert_undoable(self, buffer, tag, start, end):
115+
if tag.get_property("name") == "hyperlink":
116+
return
115117
if not self.undo_in_progress:
116118
self._empty_redo_stack()
117119
if self.not_undoable_action:

gramps/plugins/docgen/cairodoc.py

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def run(self):
110110
fontmap = PangoCairo.font_map_new()
111111
fontmap.set_resolution(DPI)
112112
pango_context = fontmap.create_context()
113+
pango_context.set_round_glyph_positions(False)
113114
options = cairo.FontOptions()
114115
options.set_hint_metrics(cairo.HINT_METRICS_OFF)
115116
if is_quartz():

gramps/plugins/importer/importcsv.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,13 @@ def _parse_marriage(self, line_number, row, col):
625625
):
626626
# Just adding a note or tag to a marriage event
627627
marriage = self.lookup("event", marriage_ref)
628+
if marriage is None:
629+
LOG.warning("no marriage found for ref %s" % marriage_ref)
630+
return
628631
if tag:
629632
self.add_tag(marriage, tag)
630633
if note:
631-
self.add_note(NoteType.MARRIAGE, marriage, note)
634+
self.add_note(NoteType.EVENT, marriage, note)
632635
self.db.commit_event(marriage, self.trans)
633636
return
634637

@@ -678,7 +681,7 @@ def _parse_marriage(self, line_number, row, col):
678681
if tag:
679682
self.add_tag(marriage, tag)
680683
if note:
681-
self.add_note(NoteType.MARRIAGE, marriage, note)
684+
self.add_note(NoteType.EVENT, marriage, note)
682685
self.db.commit_event(marriage, self.trans)
683686

684687
self.db.commit_family(family, self.trans)
@@ -1346,9 +1349,9 @@ def add_note(self, note_type, obj, note):
13461349
self.db.add_note(new_note, self.trans)
13471350
obj.add_note(new_note.handle)
13481351

1349-
if note_type == NoteType.Person:
1352+
if note_type == NoteType.PERSON:
13501353
self.db.commit_person(obj, self.trans)
1351-
elif note_type == NoteType.Event:
1354+
elif note_type == NoteType.EVENT:
13521355
self.db.commit_event(obj, self.trans)
1353-
elif note_type == NoteType.Family:
1356+
elif note_type == NoteType.FAMILY:
13541357
self.db.commit_family(obj, self.trans)

0 commit comments

Comments
 (0)