Skip to content

Commit

Permalink
Merge branch 'gramps52'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Hall committed Jul 26, 2024
2 parents d7b5fd9 + e7e0728 commit e84b26d
Show file tree
Hide file tree
Showing 75 changed files with 59,549 additions and 21,997 deletions.
477 changes: 396 additions & 81 deletions ChangeLog

Large diffs are not rendered by default.

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

2024-04-06
Version 5.2.2
* Updated translations: cs, de, de_AT, es, fi, he, hr, nb, nl, pl, ru, sk, sv,
Expand Down
11 changes: 7 additions & 4 deletions aio/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ pacman -S --needed --noconfirm \
upx
pacman -S --needed --noconfirm mingw-w64-x86_64-toolchain

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
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
pacman -U --needed --noconfirm mingw-w64-x86_64-python-cx-freeze-6.15.9-1-any.pkg.tar.zst

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
pacman -U --needed --noconfirm mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz

pacman -S --needed --noconfirm mingw-w64-x86_64-python-bsddb3
Expand Down Expand Up @@ -92,16 +95,16 @@ dicts=(
for dict in "${dicts[@]}"; do
dir=${dict%:*}
lang=${dict#*:}
wget ${rootdir}${dir}/index.aff
wget --no-verbose ${rootdir}${dir}/index.aff
mv index.aff ${lang}.aff
wget ${rootdir}${dir}/index.dic
wget --no-verbose ${rootdir}${dir}/index.dic
mv index.dic ${lang}.dic
done
popd

mkdir -p /mingw64/share/enchant/voikko
pushd /mingw64/share/enchant/voikko
wget -N https://www.puimula.org/htp/testing/voikko-snapshot-v5/dict.zip
wget --no-verbose -N https://www.puimula.org/htp/testing/voikko-snapshot-v5/dict.zip
unzip -o dict.zip
rm dict.zip
popd
Expand Down
1 change: 1 addition & 0 deletions data/org.gramps_project.Gramps.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<content_rating type="oars-1.1" />

<releases>
<release date="2024-07-13" version="5.2.3" />
<release date="2024-04-06" version="5.2.2" />
<release date="2024-03-24" version="5.2.1" />
<release date="2024-02-23" version="5.2.0" />
Expand Down
6 changes: 2 additions & 4 deletions gramps/gen/datehandler/_date_fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class DateParserFR(DateParser):
converted, the text string is assigned.
"""

month_to_int = DateParser.month_to_int

modifier_to_int = {
"avant": Date.MOD_BEFORE,
"av.": Date.MOD_BEFORE,
Expand Down Expand Up @@ -110,8 +108,6 @@ def init_strings(self):
can be coded after DateParser.init_strings(self) call, that way they
override stuff from this method. See DateParserRU() as an example.
"""
DateParser.init_strings(self)

DateParser.calendar_to_int.update(
{
"révolutionnaire": Date.CAL_FRENCH,
Expand Down Expand Up @@ -189,6 +185,8 @@ def init_strings(self):
}
)

DateParser.init_strings(self)

# This self._numeric is different from the base
# avoid bug gregorian / french calendar conversion (+/-10 days)

Expand Down
4 changes: 2 additions & 2 deletions gramps/gen/datehandler/_date_zh_TW.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def init_strings(self):
This method compiles regular expression strings for matching dates.
"""
DateParser.init_strings(self)
_span_1 = ["自"]
_span_2 = ["至"]
_span_1 = ["自", "從"]
_span_2 = ["至", "到"]
_range_1 = ["介於"]
_range_2 = ["與"]
_range_3 = ["之間"]
Expand Down
57 changes: 25 additions & 32 deletions gramps/gen/display/name.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,8 @@ def _raw_full_surname(raw_surn_data_list):
"""method for the 'l' symbol: full surnames"""
result = ""
for raw_surn_data in raw_surn_data_list:
result += "%s %s %s " % (
raw_surn_data[_PREFIX_IN_LIST],
raw_surn_data[_SURNAME_IN_LIST],
raw_surn_data[_CONNECTOR_IN_LIST],
)
return " ".join(result.split()).strip()
result += __format_raw_surname(raw_surn_data)
return result.strip()


def _raw_primary_surname(raw_surn_data_list):
Expand All @@ -189,12 +185,7 @@ def _raw_primary_surname(raw_surn_data_list):
):
return ""
else:
result = "%s %s %s" % (
raw_surn_data[_PREFIX_IN_LIST],
raw_surn_data[_SURNAME_IN_LIST],
raw_surn_data[_CONNECTOR_IN_LIST],
)
return " ".join(result.split())
return __format_raw_surname(raw_surn_data).strip()
return ""


Expand Down Expand Up @@ -265,12 +256,7 @@ def _raw_patro_surname(raw_surn_data_list):
raw_surn_data[_TYPE_IN_LIST][0] == _ORIGINPATRO
or raw_surn_data[_TYPE_IN_LIST][0] == _ORIGINMATRO
):
result = "%s %s %s" % (
raw_surn_data[_PREFIX_IN_LIST],
raw_surn_data[_SURNAME_IN_LIST],
raw_surn_data[_CONNECTOR_IN_LIST],
)
return " ".join(result.split())
return __format_raw_surname(raw_surn_data).strip()
return ""


Expand Down Expand Up @@ -321,26 +307,17 @@ def _raw_nonpatro_surname(raw_surn_data_list):
and raw_surn_data[_TYPE_IN_LIST][0] != _ORIGINPATRO
and raw_surn_data[_TYPE_IN_LIST][0] != _ORIGINMATRO
):
result += "%s %s %s " % (
raw_surn_data[_PREFIX_IN_LIST],
raw_surn_data[_SURNAME_IN_LIST],
raw_surn_data[_CONNECTOR_IN_LIST],
)
return " ".join(result.split()).strip()
result += __format_raw_surname(raw_surn_data)
return result.strip()


def _raw_nonprimary_surname(raw_surn_data_list):
"""method for the 'r' symbol: nonprimary surnames"""
result = ""
for raw_surn_data in raw_surn_data_list:
if not raw_surn_data[_PRIMARY_IN_LIST]:
result = "%s %s %s %s" % (
result,
raw_surn_data[_PREFIX_IN_LIST],
raw_surn_data[_SURNAME_IN_LIST],
raw_surn_data[_CONNECTOR_IN_LIST],
)
return " ".join(result.split())
result += __format_raw_surname(raw_surn_data)
return result.strip()


def _raw_prefix_surname(raw_surn_data_list):
Expand Down Expand Up @@ -373,7 +350,23 @@ def cleanup_name(namestring):
else:
result += " " + val

result = result.replace(" - ", "-")
return result


def __format_raw_surname(raw_surn_data):
"""
Return a formatted string representing one surname part.
If the connector is a hyphen, don't pad it with spaces.
"""
result = raw_surn_data[_PREFIX_IN_LIST]
if result:
result += " "
result += raw_surn_data[_SURNAME_IN_LIST]
if result and raw_surn_data[_CONNECTOR_IN_LIST] != "-":
result += " %s " % raw_surn_data[_CONNECTOR_IN_LIST]
else:
result += raw_surn_data[_CONNECTOR_IN_LIST]
return result


Expand Down
19 changes: 14 additions & 5 deletions gramps/gen/plug/docgen/treedoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from ..menu import NumberOption, TextOption, EnumeratedListOption
from ...constfunc import win
from ...config import config
from ...errors import ReportError
from ...const import GRAMPS_LOCALE as glocale

_ = glocale.translation.gettext
Expand Down Expand Up @@ -130,7 +131,7 @@

if win():
_LATEX_FOUND = search_for("lualatex.exe")
DETACHED_PROCESS = 8
CREATE_NO_WINDOW = 0x8000000
else:
_LATEX_FOUND = search_for("lualatex")

Expand Down Expand Up @@ -803,19 +804,27 @@ def close(self):

with tempfile.TemporaryDirectory() as tmpdir:
basename = os.path.basename(self._filename)
args = ["lualatex", "-output-directory", tmpdir, "-jobname", basename[:-4]]
args = ["lualatex", "--jobname", basename[:-4]]
if win():
proc = Popen(
args,
stdin=PIPE,
stdout=PIPE,
stderr=PIPE,
creationflags=DETACHED_PROCESS,
cwd=tmpdir,
creationflags=CREATE_NO_WINDOW,
)
else:
proc = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
proc = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, cwd=tmpdir)
proc.communicate(input=self._tex.getvalue().encode("utf-8"))
shutil.copy(os.path.join(tmpdir, basename), self._filename)

temp_output_file = os.path.join(tmpdir, basename)
if os.path.isfile(temp_output_file):
shutil.copy(temp_output_file, self._filename)
else:
raise ReportError(
_("Empty report"), _("Could not create %s") % self._filename
)


# ------------------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions gramps/gen/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ def image_size(source):
import imagesize

return imagesize.get(source)
except (ImportError, FileNotFoundError):
# python-imagesize is not installed or the file does not exist.
except (ImportError, FileNotFoundError, ValueError):
# python-imagesize is not installed, the file does not exist, or
# the size cannot be determined by imagesize.
# So Trying to get image size with Gdk.
try:
img = GdkPixbuf.Pixbuf.new_from_file(source)
Expand Down
6 changes: 3 additions & 3 deletions gramps/gui/aboutdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ def get_versions(self):
class AuthorParser(handler.ContentHandler):
"""Parse the ``authors.xml`` file to show in the About dialog.
The ``authors.xml`` file has the same format as the one in the `svn2cl
<http://ch.tudelft.nl/~arthur/svn2cl/>`_ package, with an additional
``title`` tag in the ``author`` element. For example::
The ``authors.xml`` file has the same format as the one in the `svn2cl`
package, with an additional ``title`` tag in the ``author`` element.
For example::
<author uid="dallingham" title="author">
Don Allingham &lt;<html:a href="mailto:don@gramps-project.org">don@gramps-project.org</html:a>&gt;
Expand Down
2 changes: 1 addition & 1 deletion gramps/gui/editors/displaytabs/repoembedlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class RepoEmbedList(EmbeddedList, DbGUIElement):
# (name, sortcol in model, width, markup/text, weigth_col
_column_names = [
(_("ID"), 0, 75, TEXT_COL, -1, None),
(_("Title"), 1, 200, TEXT_COL, -1, None),
(_("Name"), 1, 200, TEXT_COL, -1, None),
(_("Call Number"), 2, 125, TEXT_COL, -1, None),
(_("Type"), 3, 100, TEXT_COL, -1, None),
(_("Private"), 4, 30, ICON_COL, -1, "gramps-lock"),
Expand Down
4 changes: 3 additions & 1 deletion gramps/gui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import os
import sys
import threading
from urllib.parse import urljoin, quote as urlquote

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

if not norm_path.startswith("file://"):
norm_path = "file://" + norm_path
norm_path = urljoin("file://", urlquote(norm_path))

try:
Gio.AppInfo.launch_default_for_uri(norm_path)
except GLib.Error as error:
Expand Down
2 changes: 1 addition & 1 deletion gramps/gui/widgets/styledtextbuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def _remove_style_from_selection(self, style):
start, end = self._get_selection()
tags = self._get_tag_from_range(start.get_offset(), end.get_offset())
for tag_name, tag_data in tags.items():
if tag_name.startswith(str(style)):
if tag_name is not None and tag_name.startswith(str(style)):
for start, end in tag_data:
self.remove_tag_by_name(
tag_name,
Expand Down
2 changes: 2 additions & 0 deletions gramps/gui/widgets/undoablestyledbuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def undo_disabled(self):
self.not_undoable_action = oldflag

def on_tag_insert_undoable(self, buffer, tag, start, end):
if tag.get_property("name") == "hyperlink":
return
if not self.undo_in_progress:
self._empty_redo_stack()
if self.not_undoable_action:
Expand Down
1 change: 1 addition & 0 deletions gramps/plugins/docgen/cairodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def run(self):
fontmap = PangoCairo.font_map_new()
fontmap.set_resolution(DPI)
pango_context = fontmap.create_context()
pango_context.set_round_glyph_positions(False)
options = cairo.FontOptions()
options.set_hint_metrics(cairo.HINT_METRICS_OFF)
if is_quartz():
Expand Down
13 changes: 8 additions & 5 deletions gramps/plugins/importer/importcsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,13 @@ def _parse_marriage(self, line_number, row, col):
):
# Just adding a note or tag to a marriage event
marriage = self.lookup("event", marriage_ref)
if marriage is None:
LOG.warning("no marriage found for ref %s" % marriage_ref)
return
if tag:
self.add_tag(marriage, tag)
if note:
self.add_note(NoteType.MARRIAGE, marriage, note)
self.add_note(NoteType.EVENT, marriage, note)
self.db.commit_event(marriage, self.trans)
return

Expand Down Expand Up @@ -678,7 +681,7 @@ def _parse_marriage(self, line_number, row, col):
if tag:
self.add_tag(marriage, tag)
if note:
self.add_note(NoteType.MARRIAGE, marriage, note)
self.add_note(NoteType.EVENT, marriage, note)
self.db.commit_event(marriage, self.trans)

self.db.commit_family(family, self.trans)
Expand Down Expand Up @@ -1346,9 +1349,9 @@ def add_note(self, note_type, obj, note):
self.db.add_note(new_note, self.trans)
obj.add_note(new_note.handle)

if note_type == NoteType.Person:
if note_type == NoteType.PERSON:
self.db.commit_person(obj, self.trans)
elif note_type == NoteType.Event:
elif note_type == NoteType.EVENT:
self.db.commit_event(obj, self.trans)
elif note_type == NoteType.Family:
elif note_type == NoteType.FAMILY:
self.db.commit_family(obj, self.trans)
Loading

0 comments on commit e84b26d

Please sign in to comment.