diff -Nru gramps-4.2.4~dfsg/ChangeLog gramps-4.2.5~dfsg/ChangeLog --- gramps-4.2.4~dfsg/ChangeLog 1970-01-01 00:00:00.000000000 +0000 +++ gramps-4.2.5~dfsg/ChangeLog 2016-12-15 21:55:19.000000000 +0000 @@ -0,0 +1,310 @@ +2016-12-15 romjerome + + * gramps/gen/const.py: make official 4.2.5 release + +2016-12-15 romjerome + + * NEWS: update News file + +2016-12-15 romjerome + + * gramps/plugins/importer/importprogen.py: fix a missing import + +2016-12-15 romjerome + + * gramps/gui/views/tags.py: Tag editor: Tweak improvement on buttons + order + +2016-12-15 SNoiraud + + * gramps/gui/widgets/grampletbar.py: 9340: The configparser is + assuming the wrong encoding. + +2016-12-14 SNoiraud + + * gramps/plugins/webreport/narrativeweb.py: 9563: Sorting in family + tab of narrated web report + +2016-12-13 Leonhaeuser + + * po/de.po: fix 0009696 + +2016-12-14 Sam Manzi + + * gramps/grampsapp.py, gramps/plugins/gramplet/gramplet.gpr.py, + gramps/plugins/lib/libmetadata.py, + gramps/plugins/lib/maps/constants.py, + gramps/plugins/lib/maps/datelayer.py, + gramps/plugins/lib/maps/dummylayer.py, + gramps/plugins/lib/maps/dummynogps.py, + gramps/plugins/lib/maps/geography.py, + gramps/plugins/lib/maps/kmllayer.py, + gramps/plugins/lib/maps/lifewaylayer.py, + gramps/plugins/lib/maps/markerlayer.py, + gramps/plugins/lib/maps/messagelayer.py, + gramps/plugins/lib/maps/osmgps.py, + gramps/plugins/lib/maps/selectionlayer.py, + gramps/plugins/view/geography.gpr.py: 9801 Silence remaining + PyGIWarning + +2016-12-13 SNoiraud + + * gramps/plugins/webreport/narrativeweb.py: 9563: Sorting of + relationships in family tab of narrated web report + +2016-12-10 Josip + + * gramps/grampsapp.py: Support for Windows Python3 pythonw.exe + +2016-12-10 romjerome + + * NEWS: start to update NEWS + +2016-12-09 Nick Hall + + * gramps/gen/utils/location.py: 9799: Use latest valid date rather + than today This is useful for historic places when an event date is not + available. + +2016-12-09 Nick Hall + + * gramps/gen/utils/location.py: 9813: Modify endonym handling in + place displayer If no language code is matched, the default name is now the first in + the list, rather than a name with no language code. + +2016-12-09 Nick Hall + + * gramps/gen/display/place.py: 9737: Fix house number concatenation + +2016-12-07 Espen Berg + + * gramps/plugins/rel/rel_no.py: Corrected another typo in + relationship calculator, Norwegian + +2016-12-07 Espen Berg + + * gramps/plugins/rel/rel_no.py: Language correction in Norwegian + locale relationship calculator + +2016-12-06 prculley + + * gramps/gen/merge/mergefamilyquery.py: bug 9818 allow merging of + families with one or more parents in common + +2016-12-06 vantu5z + + * po/ru.po: update Russian translation + +2016-12-05 SNoiraud + + * gramps/gui/views/navigationview.py: 7309: Jump to Gramps ID + functionality doesn't work + +2016-12-05 romjerome + + * po/fr.po: update french translation + +2016-12-05 romjerome + + * po/gramps.pot: 9276: update translation strings template No new entry, update references and comments + +2016-12-05 romjerome + + * gramps/gui/views/treemodels/placemodel.py: 9276: ability to search + alternate place names when selecting place + +2016-12-05 romjerome + + * po/fr.po: typo on french translation + +2016-12-04 Espen Berg + + * po/nb.po: Cleaned out one more line in nb.po + +2016-12-04 Espen Berg + + * po/nb.po: The unlocking message is on one loooong line. Inserted + line breaks in Norwegian translation for cleanliness + +2016-12-03 Espen Berg + + * po/nb.po: Revising Norwegian bokmål language file (at last) + +2016-12-03 Espen Berg + + * po/nb.po: Revising Norwegian bokmål language file (at last) + +2016-12-03 romjerome + + * gramps/plugins/tool/check.py: 9812: 'Check and Repair' tool + ignores some objects with tag support + +2016-11-30 vantu5z + + * po/ru.po: update Russian translation + +2016-11-29 romjerome + + * gramps/plugins/lib/maps/geography.py: 9815: Fix clear map action + on Geography + +2016-11-29 Matti Niemelä + + * po/fi.po: Update finnish translation + +2016-11-28 Zdeněk Hataš + + * po/cs.po: czech translation update + +2016-11-26 romjerome + + * debian/control: 9801: recommend 'gir1.2-goocanvas-2.0' on debian + package + +2016-11-26 romjerome + + * gramps/plugins/tool/check.py: 8555: Database repair tool always + modify all source objects + +2016-11-24 romjerome + + * po/fr.po: Update french translation + +2016-11-24 romjerome + + * po/gramps.pot: Update translation strings template + +2016-11-24 romjerome + + * po/fr.po: typo on french translation + +2016-11-22 Nick Hall + + * gramps/plugins/gramplet/locations.py: 9534: Exclude places outside + valid date ranges + +2016-11-10 Leonhaeuser + + * po/de.po: update German translation + +2016-11-01 Nick Hall + + * gramps/gui/glade/editldsord.glade: 9767: Fix icon and tooltip in + LDS editor The icon on the family selection button was removed by mistake in + commit 75009f0. + +2016-10-30 prculley + + * gramps/plugins/lib/libgedcom.py: bug 9755, fix duplicated Gramps + IDs on Gedcom import + +2016-10-29 Sam Manzi + + * gramps/gui/configure.py: 9685 Fix Unicode error - Markup for + invalid date format + +2016-10-25 prculley + + * gramps/plugins/importer/importcsv.py: Fix bug 9733, CSV import + Fails, 9676, failure for certain types of cross references etc. + +2016-10-24 prculley + + * gramps/plugins/importer/importvcard.py: bug 9458, fix Import Vcard + can create multiple surnames with all selected as 'Primary' + +2016-10-16 prculley + + * gramps/plugins/lib/libgedcom.py: bug 8993; fix Gedcom import in + some alternate languages; improper date parsing + +2016-10-23 romjerome + + * po/fr.po: typo on the french translation + +2016-10-21 SNoiraud + + * gramps/gui/plug/export/_exportassistant.py, + gramps/gui/plug/quick/_textbufdoc.py: 8250 and 9736 : remove patchs. + need to found another solution. + +2016-10-18 vantu5z + + * po/ru.po: update russian translation + +2016-10-16 SNoiraud + + * gramps/gui/plug/quick/_textbufdoc.py: 9736: Export options + 'Preview' buttons create hidden quickreport. + +2016-10-12 Paul Franklin + + * gramps/gen/datehandler/_date_cs.py, + gramps/gen/datehandler/_dateparser.py: 9739: Wrong parsing Numeric + date format for cs_CZ locale + +2016-10-11 SNoiraud + + * gramps/gui/plug/quick/_textbufdoc.py: 9736: Export options + 'Preview' buttons create hidden quickreport. + +2016-10-04 Matti Niemelä + + * po/fi.po: Update finnish translation + +2016-10-03 Leonhaeuser + + * po/de.po: update German translation + +2016-10-01 Zdeněk Hataš + + * po/cs.po: czech translation update + +2016-09-28 romjerome + + * data/man/en.rst: typo, Change FICHIER to File + +2016-09-28 Lajos Nemeséri + + * po/hu.po: Update Hungarian translation + +2016-09-25 Nick Hall + + * gramps/gui/glade/styleeditor.glade: 9721: Fix alignment radio + buttons in style editor + +2016-09-16 SNoiraud + + * gramps/gui/editors/displaytabs/citationembedlist.py, + gramps/gui/selectors/baseselector.py: 9700: Select Place search & + Source/Citation hierarchy should NOT be expanded + +2016-09-13 Sveinn í Felli + + * po/is.po: Add 9693: Icelandic translation update(msgfmt error + fixed) + +2016-09-12 Sveinn í Felli + + * po/is.po: Add 9693: Icelandic translation update + +2016-09-10 John Ralls + + * mac/Info.plist, mac/gramps.bundle, mac/gramps.modules: Add gir + files to bundle. Enables change of library paths in the typelibs to point at + @executable_path by gtk-mac-bundler. + +2016-08-18 John Ralls + + * mac/gramps.bundle: Revert "Remove pango modules from bundle, pango + no longer uses them." This reverts commit e311de19649371d59c2ab535d4564ee725963b4f because + for the moment we have to build with an older Pango. + +2016-08-18 John Ralls + + * mac/gramps.bundle: escape illegal '--' in comment. + +2016-09-04 romjerome + + * bump to '4.2.5' + diff -Nru gramps-4.2.4~dfsg/data/man/en.rst gramps-4.2.5~dfsg/data/man/en.rst --- gramps-4.2.4~dfsg/data/man/en.rst 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/data/man/en.rst 2016-12-15 21:55:19.000000000 +0000 @@ -92,9 +92,9 @@ might produce different gramps IDs in the resulting database. - **-e** , **--export=** *FICHIER* + **-e** , **--export=** *FILE* Export data into *FILE* . For **gramps-xml** , **gedcom** - , **wft** , **gramps-pkg** , et **geneweb** , the *FILE* is the + , **wft** , **gramps-pkg** , and **geneweb** , the *FILE* is the name of the resulting file. When more than one output file is given, each has to be preceded diff -Nru gramps-4.2.4~dfsg/debian/changelog gramps-4.2.5~dfsg/debian/changelog --- gramps-4.2.4~dfsg/debian/changelog 2016-10-23 17:59:03.000000000 +0000 +++ gramps-4.2.5~dfsg/debian/changelog 2017-01-09 18:18:18.000000000 +0000 @@ -1,3 +1,20 @@ +gramps (4.2.5~dfsg-1) unstable; urgency=medium + + * New upstream release + * Refresh patch, dropped some changes as applied upstream + * Update patch header + * Update copyrights + * Update testsuite execution according to upstream Travis CI + + -- Ross Gammon Mon, 09 Jan 2017 19:18:18 +0100 + +gramps (4.2.4~dfsg-1~bpo8+1) jessie-backports; urgency=medium + + * Rebuild for jessie-backports. + * Update branch in gbp.conf & Vcs-Git URL. + + -- Ross Gammon Sat, 05 Nov 2016 18:16:10 +0100 + gramps (4.2.4~dfsg-1) unstable; urgency=medium * New upstream release diff -Nru gramps-4.2.4~dfsg/debian/control gramps-4.2.5~dfsg/debian/control --- gramps-4.2.4~dfsg/debian/control 2016-10-23 17:59:03.000000000 +0000 +++ gramps-4.2.5~dfsg/debian/control 2017-01-09 18:18:18.000000000 +0000 @@ -10,8 +10,6 @@ python3-all, python3-setuptools, python3-nose, - python3-nose-exclude, - python3-django, gir1.2-gtk-3.0 (>= 3.10.0), python3-gi (>= 3.12.0), python3-gi-cairo, @@ -53,10 +51,10 @@ python-gramps, python3-gramps Description: Genealogical research program - GRAMPS is an Open Source genealogy program written in Python, using + Gramps is an Open Source genealogy program written in Python, using the GTK/GNOME interface. It is an extremely flexible program fitting the needs for both the amateur genealogist and serious genealogical researcher. - GRAMPS has the ability to import GEDCOM files exported from many + Gramps has the ability to import GEDCOM files exported from many proprietary genealogy programs and can produce a large number of reports in many popular formats. diff -Nru gramps-4.2.4~dfsg/debian/copyright gramps-4.2.5~dfsg/debian/copyright --- gramps-4.2.4~dfsg/debian/copyright 2016-10-23 17:59:03.000000000 +0000 +++ gramps-4.2.5~dfsg/debian/copyright 2017-01-09 18:18:18.000000000 +0000 @@ -86,6 +86,7 @@ 2014, Gerald Kunzmann 2015, Lajos Nemeséri 2015, Detlef Wolz + 2016, Paul R. Culley License: GPL-2+ Files: data/javascript/jquery.flexbox* diff -Nru gramps-4.2.4~dfsg/debian/patches/gi-import-version.patch gramps-4.2.5~dfsg/debian/patches/gi-import-version.patch --- gramps-4.2.4~dfsg/debian/patches/gi-import-version.patch 2016-10-23 17:59:03.000000000 +0000 +++ gramps-4.2.5~dfsg/debian/patches/gi-import-version.patch 2017-01-09 18:18:18.000000000 +0000 @@ -9,34 +9,12 @@ right version of the library gets loaded. . A pull request has been submitted against the master branch as it will - be a long time before the warnings turin into errors. Therefore, + be a long time before the warnings turn into errors. Therefore, it will be after Gramps 5.0 is released that the patch can be dropped. Forwarded: https://github.com/gramps-project/gramps/pull/133 Author: Ross Gammon -Last-Update: 2016-05-08 +Last-Update: 2017-01-09 ---- gramps.orig/gramps/plugins/view/geography.gpr.py -+++ gramps/gramps/plugins/view/geography.gpr.py -@@ -44,6 +44,8 @@ - if repository.enumerate_versions("OsmGpsMap"): - try : - # current osmgpsmap support GTK3 -+ import gi -+ gi.require_version('OsmGpsMap', '1.0') - from gi.repository import OsmGpsMap as osmgpsmap - if osmgpsmap._version < '0.8': - _LOG.warning( _("OsmGpsMap module not loaded. " ---- gramps.orig/gramps/plugins/gramplet/gramplet.gpr.py -+++ gramps/gramps/plugins/gramplet/gramplet.gpr.py -@@ -384,6 +384,8 @@ - from gi import Repository - repository = Repository.get_default() - if repository.enumerate_versions("GExiv2"): -+ import gi -+ gi.require_version('GExiv2', '0.10') - from gi.repository import GExiv2 - available = True - else: --- gramps.orig/gramps/gui/editors/editaddress.py +++ gramps/gramps/gui/editors/editaddress.py @@ -37,6 +37,8 @@ @@ -72,7 +50,7 @@ except: --- gramps.orig/gramps/grampsapp.py +++ gramps/gramps/grampsapp.py -@@ -195,6 +195,8 @@ +@@ -200,6 +200,8 @@ """ py_str = '%d.%d.%d' % sys.version_info[:3] try: @@ -81,12 +59,3 @@ from gi.repository import Gtk try: gtkver_str = '%d.%d.%d' % (Gtk.get_major_version(), -@@ -245,6 +247,8 @@ - from gi import Repository - repository = Repository.get_default() - if repository.enumerate_versions("OsmGpsMap"): -+ import gi -+ gi.require_version('OsmGpsMap', '1.0') - from gi.repository import OsmGpsMap as osmgpsmap - try: - osmgpsmap_str = osmgpsmap._version diff -Nru gramps-4.2.4~dfsg/debian/rules gramps-4.2.5~dfsg/debian/rules --- gramps-4.2.4~dfsg/debian/rules 2016-10-23 17:59:03.000000000 +0000 +++ gramps-4.2.5~dfsg/debian/rules 2017-01-09 18:18:18.000000000 +0000 @@ -12,14 +12,14 @@ # Override auto test to enable node tests override_dh_auto_test: HOME=$(CURDIR)/build \ - DJANGO_SETTINGS_MODULE=gramps.webapp.settings nosetests3 -vv \ + nosetests3 -vv \ --exclude=TestcaseGenerator \ --exclude=vcard \ --exclude=merge_ref_test \ - --exclude=test3b_delete_tree_constraint \ - --exclude=test_consistent_with_DISPLAY_env \ --exclude=test4_arbitrary_uncode_path \ - --exclude-dir=gramps/webapp + --exclude=user_test \ + --exclude=webapp \ + gramps # Override of auto_install to remove information from package override_dh_auto_install: diff -Nru gramps-4.2.4~dfsg/gramps/gen/datehandler/_date_cs.py gramps-4.2.5~dfsg/gramps/gen/datehandler/_date_cs.py --- gramps-4.2.4~dfsg/gramps/gen/datehandler/_date_cs.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gen/datehandler/_date_cs.py 2016-12-15 21:55:19.000000000 +0000 @@ -171,6 +171,9 @@ 'vyp.' : Date.QUAL_CALCULATED, } + # bug 9739 _grampslocale.py gets '%-d.%-m.%Y' and makes it be '%/d.%/m.%Y' + fmt = DateParser.fmt.replace('/', '') # so counteract that + def init_strings(self): DateParser.init_strings(self) self._text2 = re.compile('(\d+)?\.?\s+?%s\.?\s*((\d+)(/\d+)?)?\s*$' diff -Nru gramps-4.2.4~dfsg/gramps/gen/datehandler/_dateparser.py gramps-4.2.5~dfsg/gramps/gen/datehandler/_dateparser.py --- gramps-4.2.4~dfsg/gramps/gen/datehandler/_dateparser.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gen/datehandler/_dateparser.py 2016-12-15 21:55:19.000000000 +0000 @@ -194,6 +194,7 @@ _locale = GrampsLocale(lang='en', languages='en') + fmt = _grampslocale.tformat _fmt_parse = re.compile(".*%(\S).*%(\S).*%(\S).*") # RFC-2822 only uses capitalized English abbreviated names, no locales. @@ -343,8 +344,7 @@ Date.CAL_SWEDISH : self._parse_swedish, } - fmt = _grampslocale.tformat - match = self._fmt_parse.match(fmt.lower()) + match = self._fmt_parse.match(self.fmt.lower()) if match: self.dmy = (match.groups() == ('d', 'm', 'y') or \ match.groups() == ('d', 'b', 'y')) diff -Nru gramps-4.2.4~dfsg/gramps/gen/display/place.py gramps-4.2.5~dfsg/gramps/gen/display/place.py --- gramps-4.2.4~dfsg/gramps/gen/display/place.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gen/display/place.py 2016-12-15 21:55:19.000000000 +0000 @@ -65,13 +65,18 @@ else: places = places[index:] - names = [item[0] for item in places] - if config.get('preferences.place-number'): - if len(places) > 1 and int(places[0][1]) == PlaceType.NUMBER: - names = names[1:] - names[0] = places[0][0] + ' ' + names[0] + types = [item[1] for item in places] + try: + idx = types.index(PlaceType.NUMBER) + except ValueError: + idx = None + if idx is not None and len(places) > idx+1: + combined = (places[idx][0] + ' ' + places[idx+1][0], + places[idx+1][1]) + places = places[:idx] + [combined] + places[idx+2:] + names = [item[0] for item in places] if config.get('preferences.place-reverse'): names.reverse() diff -Nru gramps-4.2.4~dfsg/gramps/gen/merge/mergefamilyquery.py gramps-4.2.5~dfsg/gramps/gen/merge/mergefamilyquery.py --- gramps-4.2.4~dfsg/gramps/gen/merge/mergefamilyquery.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gen/merge/mergefamilyquery.py 2016-12-15 21:55:19.000000000 +0000 @@ -134,15 +134,35 @@ with DbTxn(_('Merge Family'), self.database) as trans: - phoenix_father = self.database.get_person_from_handle(self.phoenix_fh) - titanic_father = self.database.get_person_from_handle(self.titanic_fh) - self.merge_person(phoenix_father, titanic_father, 'father', trans) + if self.phoenix_fh != self.titanic_fh: + if self.phoenix_fh: + phoenix_father = self.database.get_person_from_handle( + self.phoenix_fh) + else: + phoenix_father = None + if self.titanic_fh: + titanic_father = self.database.get_person_from_handle( + self.titanic_fh) + else: + titanic_father = None + self.merge_person(phoenix_father, titanic_father, + 'father', trans) - phoenix_mother = self.database.get_person_from_handle(self.phoenix_mh) - titanic_mother = self.database.get_person_from_handle(self.titanic_mh) + if self.phoenix_mh != self.titanic_mh: + if self.phoenix_mh: + phoenix_mother = self.database.get_person_from_handle( + self.phoenix_mh) + else: + phoenix_mother = None + if self.titanic_mh: + titanic_mother = self.database.get_person_from_handle( + self.titanic_mh) + else: + titanic_mother = None + self.merge_person(phoenix_mother, titanic_mother, + 'mother', trans) self.phoenix = self.database.get_family_from_handle(new_handle) self.titanic = self.database.get_family_from_handle(old_handle) - self.merge_person(phoenix_mother, titanic_mother, 'mother', trans) phoenix_father = self.database.get_person_from_handle(self.phoenix_fh) phoenix_mother = self.database.get_person_from_handle(self.phoenix_mh) diff -Nru gramps-4.2.4~dfsg/gramps/gen/utils/location.py gramps-4.2.5~dfsg/gramps/gen/utils/location.py --- gramps-4.2.4~dfsg/gramps/gen/utils/location.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gen/utils/location.py 2016-12-15 21:55:19.000000000 +0000 @@ -21,7 +21,7 @@ """ Location utility functions """ -from ..lib.date import Today +from ..lib.date import Date, Today #------------------------------------------------------------------------- # @@ -33,7 +33,7 @@ Return a list of place names for display. """ if date is None: - date = Today() + date = __get_latest_date(place) visited = [place.handle] lines = [(__get_name(place, date, lang), place.get_type())] while True: @@ -53,14 +53,31 @@ return lines def __get_name(place, date, lang): - names = {} + endonym = None for place_name in place.get_all_names(): name_date = place_name.get_date_object() if name_date.is_empty() or date.match_exact(name_date): - name_lang = place_name.get_language() - if name_lang not in names: - names[name_lang] = place_name.get_value() - return names.get(lang, names.get('', '?')) + if place_name.get_language() == lang: + return place_name.get_value() + if endonym is None: + endonym = place_name.get_value() + return endonym if endonym is not None else '?' + +def __get_latest_date(place): + latest_date = None + for place_name in place.get_all_names(): + date = place_name.get_date_object() + if date.is_empty() or date.modifier == Date.MOD_AFTER: + return Today() + else: + if date.is_compound(): + date1, date2 = date.get_start_stop_range() + date = Date(*date2) + if date.modifier == Date.MOD_BEFORE: + date = date - 1 + if latest_date is None or date > latest_date: + latest_date = date + return latest_date #------------------------------------------------------------------------- # diff -Nru gramps-4.2.4~dfsg/gramps/grampsapp.py gramps-4.2.5~dfsg/gramps/grampsapp.py --- gramps-4.2.4~dfsg/gramps/grampsapp.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/grampsapp.py 2016-12-15 21:55:19.000000000 +0000 @@ -74,10 +74,15 @@ _encoding = sys.stdout.encoding except: _encoding = "UTF-8" -sys.stdout = open(sys.stdout.fileno(), mode='w', encoding=_encoding, - buffering=1, errors='backslashreplace') -sys.stderr = open(sys.stderr.fileno(), mode='w', encoding=_encoding, - buffering=1, errors='backslashreplace') + +try: + # On Windows there is no std handles in GUI mode + sys.stdout = open(sys.stdout.fileno(), mode='w', encoding=_encoding, + buffering=1, errors='backslashreplace') + sys.stderr = open(sys.stderr.fileno(), mode='w', encoding=_encoding, + buffering=1, errors='backslashreplace') +except: + pass #------------------------------------------------------------------------- # @@ -100,7 +105,7 @@ # Create the log handlers if win(): # If running in GUI mode redirect stdout and stderr to log file - if hasattr(sys.stdout, "fileno") and sys.stdout.fileno() < 0: + if not sys.stdout: logfile = os.path.join(HOME_DIR, "Gramps%s%s.log") % (VERSION_TUPLE[0], VERSION_TUPLE[1]) @@ -245,6 +250,8 @@ from gi import Repository repository = Repository.get_default() if repository.enumerate_versions("OsmGpsMap"): + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap try: osmgpsmap_str = osmgpsmap._version diff -Nru gramps-4.2.4~dfsg/gramps/gui/configure.py gramps-4.2.5~dfsg/gramps/gui/configure.py --- gramps-4.2.4~dfsg/gramps/gui/configure.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gui/configure.py 2016-12-15 21:55:19.000000000 +0000 @@ -238,7 +238,7 @@ obj.get_text(), parent=self.window) obj.set_text('%s') - self.__config.set(constant, unicode(obj.get_text())) + self.__config.set(constant, conv_to_unicode(obj.get_text())) def update_entry(self, obj, constant): """ diff -Nru gramps-4.2.4~dfsg/gramps/gui/editors/displaytabs/citationembedlist.py gramps-4.2.5~dfsg/gramps/gui/editors/displaytabs/citationembedlist.py --- gramps-4.2.4~dfsg/gramps/gui/editors/displaytabs/citationembedlist.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gui/editors/displaytabs/citationembedlist.py 2016-12-15 21:55:19.000000000 +0000 @@ -155,7 +155,7 @@ def share_button_clicked(self, obj): SelectCitation = SelectorFactory('Citation') - sel = SelectCitation(self.dbstate, self.uistate, self.track) + sel = SelectCitation(self.dbstate, self.uistate, self.track, expand=False) object = sel.run() LOG.debug("selected object: %s" % object) # the object returned should either be a Source or a Citation diff -Nru gramps-4.2.4~dfsg/gramps/gui/glade/editldsord.glade gramps-4.2.5~dfsg/gramps/gui/glade/editldsord.glade --- gramps-4.2.4~dfsg/gramps/gui/glade/editldsord.glade 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gui/glade/editldsord.glade 2016-12-15 21:55:19.000000000 +0000 @@ -1,5 +1,5 @@ - + @@ -247,11 +247,13 @@ False True True + Select Family none True False + gtk-index Selector diff -Nru gramps-4.2.4~dfsg/gramps/gui/glade/styleeditor.glade gramps-4.2.5~dfsg/gramps/gui/glade/styleeditor.glade --- gramps-4.2.4~dfsg/gramps/gui/glade/styleeditor.glade 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gui/glade/styleeditor.glade 2016-12-15 21:55:19.000000000 +0000 @@ -1,5 +1,5 @@ - + @@ -947,6 +947,7 @@ center True True + lalign False @@ -964,6 +965,7 @@ center True True + lalign False @@ -981,6 +983,7 @@ center True True + lalign False diff -Nru gramps-4.2.4~dfsg/gramps/gui/plug/export/_exportassistant.py gramps-4.2.5~dfsg/gramps/gui/plug/export/_exportassistant.py --- gramps-4.2.4~dfsg/gramps/gui/plug/export/_exportassistant.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gui/plug/export/_exportassistant.py 2016-12-15 21:55:19.000000000 +0000 @@ -120,7 +120,6 @@ #set_window is present in both parent classes ManagedWindow.set_window(self, self, None, self.top_title, isWindow=True) - self.set_modal(True) #set up callback method for the export plugins self.callback = self.pulse_progressbar diff -Nru gramps-4.2.4~dfsg/gramps/gui/plug/quick/_textbufdoc.py gramps-4.2.5~dfsg/gramps/gui/plug/quick/_textbufdoc.py --- gramps-4.2.4~dfsg/gramps/gui/plug/quick/_textbufdoc.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gui/plug/quick/_textbufdoc.py 2016-12-15 21:55:19.000000000 +0000 @@ -70,7 +70,7 @@ scrolled_window.add(document.text_view) self.window.vbox.pack_start(scrolled_window, True, True, 0) self.window.show_all() - + def build_menu_names(self, obj): return ('View', _('Quick View')) diff -Nru gramps-4.2.4~dfsg/gramps/gui/selectors/baseselector.py gramps-4.2.5~dfsg/gramps/gui/selectors/baseselector.py --- gramps-4.2.4~dfsg/gramps/gui/selectors/baseselector.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gui/selectors/baseselector.py 2016-12-15 21:55:19.000000000 +0000 @@ -53,13 +53,14 @@ IMAGE = 2 def __init__(self, dbstate, uistate, track=[], filter=None, skip=set(), - show_search_bar = True, default=None): + show_search_bar = True, default=None, expand=True): """Set up the dialog with the dbstate and uistate, track of parent windows for ManagedWindow, initial filter for the model, skip with set of handles to skip in the view, and search_bar to show the SearchBar at the top or not. """ self.filter = (2, filter, False) + self.expand = expand # Set window title, some selectors may set self.title in their __init__ if not hasattr(self, 'title'): @@ -293,8 +294,9 @@ self.setupcols = False - if not (self.model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY): - self.tree.expand_all() + if self.expand: + if not (self.model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY): + self.tree.expand_all() def column_clicked(self, obj, data): if self.sort_col != data: diff -Nru gramps-4.2.4~dfsg/gramps/gui/views/navigationview.py gramps-4.2.5~dfsg/gramps/gui/views/navigationview.py --- gramps-4.2.4~dfsg/gramps/gui/views/navigationview.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gui/views/navigationview.py 2016-12-15 21:55:19.000000000 +0000 @@ -353,7 +353,7 @@ dialog.vbox.set_spacing(10) dialog.vbox.set_border_width(12) hbox = Gtk.Box() - hbox.pack_start(Gtk.Label("%s: " % _('ID', True, True, 0)), False) + hbox.pack_start(Gtk.Label(label="%s: " % _('ID')), True, True, 0) text = Gtk.Entry() text.set_activates_default(True) hbox.pack_start(text, False, True, 0) diff -Nru gramps-4.2.4~dfsg/gramps/gui/views/tags.py gramps-4.2.5~dfsg/gramps/gui/views/tags.py --- gramps-4.2.4~dfsg/gramps/gui/views/tags.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gui/views/tags.py 2016-12-15 21:55:19.000000000 +0000 @@ -628,7 +628,7 @@ hbox.pack_start(self.color, False, False, 5) top.add_button(_('_Help'), Gtk.ResponseType.HELP) - top.add_button(_('_OK'), Gtk.ResponseType.OK) top.add_button(_('_Cancel'), Gtk.ResponseType.CANCEL) + top.add_button(_('_OK'), Gtk.ResponseType.OK) top.show_all() return top diff -Nru gramps-4.2.4~dfsg/gramps/gui/views/treemodels/placemodel.py gramps-4.2.5~dfsg/gramps/gui/views/treemodels/placemodel.py --- gramps-4.2.4~dfsg/gramps/gui/views/treemodels/placemodel.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gui/views/treemodels/placemodel.py 2016-12-15 21:55:19.000000000 +0000 @@ -126,7 +126,8 @@ return value def column_name(self, data): - return str(data[6][0]) + # need for spacing on the french translation + return _(',').join([data[6][0]] + [name[0] for name in data[7]]) def column_longitude(self, data): if not data[3]: diff -Nru gramps-4.2.4~dfsg/gramps/gui/widgets/grampletbar.py gramps-4.2.5~dfsg/gramps/gui/widgets/grampletbar.py --- gramps-4.2.4~dfsg/gramps/gui/widgets/grampletbar.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/gui/widgets/grampletbar.py 2016-12-15 21:55:19.000000000 +0000 @@ -180,7 +180,7 @@ if filename and os.path.exists(filename): cp = configparser.ConfigParser() try: - cp.read(filename) + cp.read(filename, encoding='utf-8') except: pass for sec in cp.sections(): diff -Nru gramps-4.2.4~dfsg/gramps/plugins/gramplet/gramplet.gpr.py gramps-4.2.5~dfsg/gramps/plugins/gramplet/gramplet.gpr.py --- gramps-4.2.4~dfsg/gramps/plugins/gramplet/gramplet.gpr.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/gramplet/gramplet.gpr.py 2016-12-15 21:55:19.000000000 +0000 @@ -384,6 +384,8 @@ from gi import Repository repository = Repository.get_default() if repository.enumerate_versions("GExiv2"): + import gi + gi.require_version('GExiv2', '0.10') from gi.repository import GExiv2 available = True else: diff -Nru gramps-4.2.4~dfsg/gramps/plugins/gramplet/locations.py gramps-4.2.5~dfsg/gramps/plugins/gramplet/locations.py --- gramps-4.2.4~dfsg/gramps/plugins/gramplet/locations.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/gramplet/locations.py 2016-12-15 21:55:19.000000000 +0000 @@ -35,6 +35,7 @@ from gramps.gen.errors import WindowActiveError from gramps.gui.listmodel import ListModel, NOSORT from gramps.gen.datehandler import get_date +from gramps.gen.lib import Date from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext @@ -113,19 +114,19 @@ if active_handle: active = self.dbstate.db.get_place_from_handle(active_handle) if active: - self.display_place(active, None, [active_handle]) + self.display_place(active, None, [active_handle], DateRange()) else: self.set_has_data(False) else: self.set_has_data(False) - def display_place(self, place, node, visited): + def display_place(self, place, node, visited, drange): """ Display the location hierarchy for the active place. """ pass - def add_place(self, placeref, place, node, visited): + def add_place(self, placeref, place, node, visited, drange): """ Add a place to the model. """ @@ -134,6 +135,9 @@ place_name = place.get_name().get_value() place_type = str(place.get_type()) + if drange.overlap: + place_date += ' *' + new_node = self.model.add([place.handle, place_name, place_type, @@ -141,7 +145,7 @@ place_sort], node=node) - self.display_place(place, new_node, visited + [place.handle]) + self.display_place(place, new_node, visited + [place.handle], drange) def edit_place(self, treeview): """ @@ -163,7 +167,7 @@ #------------------------------------------------------------------------- class EnclosedBy(Locations): - def display_place(self, place, node, visited): + def display_place(self, place, node, visited, drange): """ Display the location hierarchy for the active place. """ @@ -172,8 +176,12 @@ if placeref.ref in visited: continue + dr2 = drange.intersect(placeref.date) + if dr2.is_empty(): + continue + parent_place = self.dbstate.db.get_place_from_handle(placeref.ref) - self.add_place(placeref, parent_place, node, visited) + self.add_place(placeref, parent_place, node, visited, dr2) self.set_has_data(self.model.count > 0) self.model.tree.expand_all() @@ -195,7 +203,7 @@ #------------------------------------------------------------------------- class Encloses(Locations): - def display_place(self, place, node, visited): + def display_place(self, place, node, visited, drange): """ Display the location hierarchy for the active place. """ @@ -209,7 +217,12 @@ placeref = None for placeref in child_place.get_placeref_list(): if placeref.ref == place.handle: - self.add_place(placeref, child_place, node, visited) + + dr2 = drange.intersect(placeref.date) + if dr2.is_empty(): + continue + + self.add_place(placeref, child_place, node, visited, dr2) self.set_has_data(self.model.count > 0) self.model.tree.expand_all() @@ -224,3 +237,71 @@ place.handle, include_classes=['Place']): return True return False + +#------------------------------------------------------------------------- +# +# DateRange class +# +#------------------------------------------------------------------------- +class DateRange: + """ + A class that represents a date range. + """ + def __init__(self, source=None): + self.start = None + self.stop = None + self.overlap = False + if source: + self.start = source.start + self.stop = source.stop + self.overlap = source.overlap + + def intersect(self, date): + """ + Return the intersection of the date range with a given Date object. + """ + result = DateRange(self) + start, stop = self.__get_sortvals(date) + if start is not None: + if self.start is None or start > self.start: + result.start = start + if stop is not None: + if self.stop is None or stop < self.stop: + result.stop = stop + + result.overlap = False + if result.start is not None: + if start is None or start < result.start: + result.overlap = True + if result.stop is not None: + if stop is None or stop > result.stop: + result.overlap = True + + return result + + def is_empty(self): + """ + Return True if there are no dates in the range. + """ + if self.start is None or self.stop is None: + return False + return True if self.start > self.stop else False + + def __get_sortvals(self, date): + """ + Get the sort values representing the start and end of a Date object. + """ + start = None + stop = None + if date.modifier == Date.MOD_NONE: + start = date.sortval + stop = date.sortval + elif date.modifier == Date.MOD_AFTER: + start = date.sortval + elif date.modifier == Date.MOD_BEFORE: + stop = date.sortval + elif date.is_compound(): + date1, date2 = date.get_start_stop_range() + start = Date(*date1).sortval + stop = Date(*date2).sortval + return (start, stop) diff -Nru gramps-4.2.4~dfsg/gramps/plugins/importer/importcsv.py gramps-4.2.5~dfsg/gramps/plugins/importer/importcsv.py --- gramps-4.2.4~dfsg/gramps/plugins/importer/importcsv.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/importer/importcsv.py 2016-12-15 21:55:19.000000000 +0000 @@ -44,15 +44,15 @@ #------------------------------------------------------------------------- # -# GRAMPS modules +# Gramps modules # #------------------------------------------------------------------------- from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext ngettext = glocale.translation.ngettext # else "nearby" comments are ignored -from gramps.gen.lib import (ChildRef, Citation, Event, EventRef, EventType, - Family, FamilyRelType, Name, NameType, Note, - NoteType, Person, Place, Source, Surname, Tag, +from gramps.gen.lib import (ChildRef, Citation, Event, EventRef, EventType, + Family, FamilyRelType, Name, NameType, Note, + NoteType, Person, Place, Source, Surname, Tag, PlaceName, PlaceType, PlaceRef) from gramps.gen.db import DbTxn from gramps.gen.datehandler import parser as _dp @@ -89,7 +89,7 @@ """ Return Row data by column name """ if key in col: if col[key] >= len(row): - LOG.warn("missing '%s, on line %d" % (key, line_number)) + LOG.warning("missing '%s, on line %d" % (key, line_number)) return default retval = row[col[key]].strip() if retval == "": @@ -104,10 +104,10 @@ if dbase.get_feature("skip-import-additions"): # don't add source or tags parser = CSVParser(dbase, user, None) else: - parser = CSVParser(dbase, user, (config.get('preferences.tag-on-import-format') if + parser = CSVParser(dbase, user, (config.get('preferences.tag-on-import-format') if config.get('preferences.tag-on-import') else None)) try: - with open(filename, 'r') as filehandle: + with open(filename, 'rb') as filehandle: line = filehandle.read(3) if line == codecs.BOM_UTF8: filehandle.seek(0) @@ -125,10 +125,10 @@ #------------------------------------------------------------------------- # -# CSV Parser +# CSV Parser # #------------------------------------------------------------------------- -class CSVParser(object): +class CSVParser: """Class to read data in CSV format from a file object.""" def __init__(self, dbase, user, default_tag_format=None): self.db = dbase @@ -140,7 +140,7 @@ self.indi_count = 0 self.place_count = 0 self.pref = {} # person ref, internal to this sheet - self.fref = {} # family ref, internal to this sheet + self.fref = {} # family ref, internal to this sheet self.placeref = {} self.place_types = {} # Build reverse dictionary, name to type number @@ -154,94 +154,83 @@ self.place_types[custom_type] = 0 self.place_types[custom_type.lower()] = 0 column2label = { - "surname": ("Lastname", "Surname", _("Surname"), "lastname", - "last_name", "surname", _("surname")), - "firstname": ("Firstname", "Given name", _("Given name"), "Given", - _("Given"), "firstname", "first_name", "given_name", - "given name", _("given name"), "given", _("given")), - "callname": ("Callname", "Call name", _("Call name"), "Call", - _("Call"), "callname", "call_name", "call name", "call", - _("call")), - "title": ("Title", _("Person or Place|Title"), "title", _("Person or Place|title")), - "prefix": ("Prefix", _("Prefix"), "prefix", _("prefix")), - "suffix": ("Suffix", _("Suffix"), "suffix", _("suffix")), - "gender": ("Gender", _("Gender"), "gender", _("gender")), - "source": ("Source", _("Source"), "source", _("source")), - "note": ("Note", _("Note"), "note", _("note")), - "birthplace": ("Birthplace", "Birth place", _("Birth place"), - "birthplace", "birth_place", "birth place", _("birth place")), - "birthplace_id": ("Birthplaceid", "Birth place id", _("Birth place id"), - "birthplaceid", "birth_place_id", "birth place id", _("birth place id"), + "surname": ("lastname", "last_name", "surname", _("surname"), + _("Surname")), + "firstname": ("firstname", "first_name", "given_name", "given", + "given name", _("given name"), _("given"), + _("Given"), _("Given name")), + "callname": ("call name", _("Call name"), "callname", "call_name", + "call", _("Call"), _("call")), + "title": ("title", _("title"), _("Person or Place|title")), + "prefix": ("prefix", _("prefix"), _("Prefix")), + "suffix": ("suffix", _("suffix"), _("Suffix")), + "gender": ("gender", _("gender"), _("Gender")), + "source": ("source", _("source"), _("Source")), + "note": ("note", _("note"), _("Note")), + "birthplace": ("birthplace", "birth_place", "birth place", + _("birth place"), _("Birth place")), + "birthplace_id": ("birthplaceid", "birth_place_id", + "birth place id", _("birth place id"), "birthplace_id"), - "birthdate": ("Birthdate", "Birth date", _("Birth date"), - "birthdate", "birth_date", "birth date", _("birth date")), - "birthsource": ("Birthsource", "Birth source", _("Birth source"), - "birthsource", "birth_source", "birth source", - _("birth source")), - "baptismplace": ("Baptismplace", "Baptism place", - _("Baptism place"), "baptismplace", "baptism place", - _("baptism place")), - "baptismplace_id": ("Baptismplaceid", "Baptism place id", - _("Baptism place id"), "baptismplaceid", "baptism place id", + "birthdate": ("birthdate", "birth_date", "birth date", + _("birth date")), + "birthsource": ("birthsource", "birth_source", "birth source", + _("birth source")), + "baptismplace": ("baptismplace", "baptism place", + _("baptism place")), + "baptismplace_id": ("baptismplaceid", "baptism place id", _("baptism place id"), "baptism_place_id", "baptismplace_id"), - "baptismdate": ("Baptismdate", "Baptism date", _("Baptism date"), - "baptismdate", "baptism date", _("baptism date")), - "baptismsource": ("Baptismsource", "Baptism source", - _("Baptism source"), "baptismsource", "baptism source", - _("baptism source")), - "burialplace": ("Burialplace", "Burial place", _("Burial place"), - "burialplace", "burial place", _("burial place")), - "burialplace_id": ("Burialplaceid", "Burial place id", _("Burial place id"), - "burialplaceid", "burial place id", _("burial place id"), - "burial_place_id", "burialplace_id"), - "burialdate": ("Burialdate", "Burial date", _("Burial date"), - "burialdate", "burial date", _("burial date")), - "burialsource": ("Burialsource", "Burial source", - _("Burial source"), "burialsource", "burial source", - _("burial source")), - "deathplace": ("Deathplace", "Death place", _("Death place"), - "deathplace", "death_place", "death place", _("death place")), - "deathplace_id": ("Deathplaceid", "Death place id", _("Death place id"), - "deathplaceid", "death_place_id", "death place id", _("death place id"), - "death_place_id", "deathplace_id"), - "deathdate": ("Deathdate", "Death date", _("Death date"), - "deathdate", "death_date", "death date", _("death date")), - "deathsource": ("Deathsource", "Death source", _("Death source"), - "deathsource", "death_source", "death source", - _("death source")), - "deathcause": ("Deathcause", "Death cause", _("Death cause"), - "deathcause", "death_cause", "death cause", _("death cause")), - "grampsid": ("Grampsid", "ID", "Gramps id", _("Gramps ID"), - "grampsid", "id", "gramps_id", "gramps id", _("Gramps id")), - "person": ("Person", _("Person"), "person", _("person")), + "baptismdate": ("baptismdate", "baptism date", _("baptism date")), + "baptismsource": ("baptismsource", "baptism source", + _("baptism source")), + "burialplace": ("burialplace", "burial place", _("burial place")), + "burialplace_id": ("burialplaceid", "burial place id", + _("burial place id"), "burial_place_id", + "burialplace_id"), + "burialdate": ("burialdate", "burial date", _("burial date")), + "burialsource": ("burialsource", "burial source", + _("burial source")), + "deathplace": ("deathplace", "death_place", "death place", + _("death place")), + "deathplace_id": ("deathplaceid", "death place id", + _("death place id"), "death_place_id", + "deathplace_id"), + "deathdate": ("deathdate", "death_date", "death date", + _("death date")), + "deathsource": ("deathsource", "death_source", "death source", + _("death source")), + "deathcause": ("deathcause", "death_cause", "death cause", + _("death cause")), + "grampsid": (_("Gramps ID"), "grampsid", "id", "gramps_id", + "gramps id"), + "person": ("person", _("person"), _("Person")), # ---------------------------------- - "child": ("Child", _("Child"), "child", _("child")), - "family": ("Family", _("Family"), "family", _("family")), + "child": ("child", _("child"), _("Child")), + "family": ("family", _("family"), _("Family")), # ---------------------------------- - "wife": ("Mother", _("Mother"), "Wife", _("Wife"), "Parent2", - _("Parent2"), "mother", _("mother"), "wife", _("wife"), - "parent2", _("parent2")), - "husband": ("Father", _("Father"), "Husband", _("Husband"), - "Parent1", _("Parent1"), "father", _("father"), "husband", - _("husband"), "parent1", _("parent1")), - "marriage": ("Marriage", _("Marriage"), "marriage", _("marriage")), - "date": ("Date", _("Date"), "date", _("date")), - "place": ("Place", _("Place"), "place", _("place")), - "place_id": ("Placeid", "place id", "Place id", "place_id", "placeid"), - "name": ("Name", _("Name"), "name", _("name")), - "type": ("Type", _("Type"), "type", _("type")), - "latitude": ("Latitude", _("latitude"), "latitude", _("latitude")), - "longitude": ("Longitude", _("Longitude"), "longitude", _("longitude")), - "code": ("Code", _("Code"), "code", _("code")), - "enclosed_by": ("Enclosed by", _("Enclosed by"), "enclosed by", _("enclosed by"), - "enclosed_by", _("enclosed_by"), "Enclosed_by", _("Enclosed_by"), - "enclosedby") + "wife": ("mother", _("mother"), _("Mother"), + "wife", _("wife"), _("Wife"), + "parent2", _("parent2")), + "husband": ("father", _("father"), _("Father"), + "husband", _("husband"), _("Husband"), + "parent1", _("parent1")), + "marriage": ("marriage", _("marriage"), _("Marriage")), + "date": ("date", _("date"), _("Date")), + "place": ("place", _("place"), _("Place")), + "place_id": ("place id", "place_id", "placeid", _("place id")), + "name": ("name", _("name"), _("Name")), + "type": ("type", _("type"), _("Type")), + "latitude": ("latitude", _("latitude")), + "longitude": ("longitude", _("longitude")), + "code": ("code", _("code"), _("Code")), + "enclosed_by": ("enclosed by", _("enclosed by"), + "enclosed_by", _("enclosed_by"), "enclosedby") } lab2col_dict = [] for key in list(column2label.keys()): for val in column2label[key]: - lab2col_dict.append((val, key)) + lab2col_dict.append((val.lower(), key)) self.label2column = dict(lab2col_dict) if default_tag_format: name = time.strftime(default_tag_format) @@ -283,10 +272,12 @@ return self.lookup(type_, id_) else: return db_lookup - elif id_.lower() in self.fref: - return self.fref[id_.lower()] else: - return None + id_ = self.db.fid2user_format(id_) + if id_.lower() in self.fref: + return self.fref[id_.lower()] + else: + return None elif type_ == "person": if id_.startswith("[") and id_.endswith("]"): id_ = self.db.id2user_format(id_[1:-1]) @@ -295,24 +286,28 @@ return self.lookup(type_, id_) else: return db_lookup - elif id_.lower() in self.pref: - return self.pref[id_.lower()] else: - return None + id_ = self.db.id2user_format(id_) + if id_.lower() in self.pref: + return self.pref[id_.lower()] + else: + return None elif type_ == "place": if id_.startswith("[") and id_.endswith("]"): - id_ = self.db.id2user_format(id_[1:-1]) + id_ = self.db.pid2user_format(id_[1:-1]) db_lookup = self.db.get_place_from_gramps_id(id_) if db_lookup is None: return self.lookup(type_, id_) else: return db_lookup - elif id_.lower() in self.placeref: - return self.placeref[id_.lower()] else: - return None + id_ = self.db.pid2user_format(id_) + if id_.lower() in self.placeref: + return self.placeref[id_.lower()] + else: + return None else: - LOG.warn("invalid lookup type in CSV import: '%s'" % type_) + LOG.warning("invalid lookup type in CSV import: '%s'" % type_) return None def storeup(self, type_, id_, object_): @@ -330,7 +325,7 @@ id_ = self.db.pid2user_format(id_) self.placeref[id_.lower()] = object_ else: - LOG.warn("invalid storeup type in CSV import: '%s'" % type_) + LOG.warning("invalid storeup type in CSV import: '%s'" % type_) def parse(self, filehandle): """ @@ -339,11 +334,11 @@ :param filehandle: open file handle positioned at start of the file """ progress_title = _('CSV Import') - with self.user.progress(progress_title, + with self.user.progress(progress_title, _('Reading data...'), 1) as step: data = self.read_csv(filehandle) - with self.user.progress(progress_title, + with self.user.progress(progress_title, _('Importing data...'), len(data)) as step: tym = time.time() self.db.disable_signals() @@ -370,7 +365,7 @@ self.indi_count = 0 self.place_count = 0 self.pref = {} # person ref, internal to this sheet - self.fref = {} # family ref, internal to this sheet + self.fref = {} # family ref, internal to this sheet self.placeref = {} header = None line_number = 0 @@ -382,7 +377,7 @@ continue ###################################### if header is None: - header = [self.cleanup_column_name(r) for r in row] + header = [self.cleanup_column_name(r.lower()) for r in row] col = {} count = 0 for key in header: @@ -401,7 +396,7 @@ elif "place" in header: self._parse_place(line_number, row, col) else: - LOG.warn("ignoring line %d" % line_number) + LOG.warning("ignoring line %d" % line_number) return None def _parse_marriage(self, line_number, row, col): @@ -418,8 +413,8 @@ husband = self.lookup("person", husband) if husband is None and wife is None: # might have children, so go ahead and add - LOG.warn("no parents on line %d; adding family anyway" % - line_number) + LOG.warning("no parents on line %d; adding family anyway" % + line_number) family = self.get_or_create_family(marriage_ref, husband, wife) # adjust gender, if not already provided if husband: @@ -433,7 +428,7 @@ wife.set_gender(Person.FEMALE) self.db.commit_person(wife, self.trans) if marriage_ref: - self.storeup("family", marriage_ref.lower(), family) + self.storeup("family", marriage_ref, family) if marriagesource: # add, if new new, marriagesource = self.get_or_create_source(marriagesource) @@ -489,8 +484,8 @@ "Parse the content of a family line" family_ref = rd(line_number, row, col, "family") if family_ref is None: - LOG.warn("no family reference found for family on line %d" % - line_number) + LOG.warning("no family reference found for family on line %d" % + line_number) return # required child = rd(line_number, row, col, "child") source = rd(line_number, row, col, "source") @@ -499,12 +494,12 @@ child = self.lookup("person", child) family = self.lookup("family", family_ref) if family is None: - LOG.warn("no matching family reference found for family " - "on line %d" % line_number) + LOG.warning("no matching family reference found for family " + "on line %d" % line_number) return if child is None: - LOG.warn("no matching child reference found for family " - "on line %d" % line_number) + LOG.warning("no matching child reference found for family " + "on line %d" % line_number) return # is this child already in this family? If so, don't add LOG.debug("children: %s", [ref.ref for ref in @@ -596,8 +591,8 @@ person = self.lookup("person", person_ref) if person is None: if surname is None: - LOG.warn("empty surname for new person on line %d" % - line_number) + LOG.warning("empty surname for new person on line %d" % + line_number) surname = "" # new person person = self.create_person() @@ -681,8 +676,8 @@ if birthsource is not None: new, birthsource = self.get_or_create_source(birthsource) if birthdate or birthplace or birthsource: - new, birth = self.get_or_create_event(person, - EventType.BIRTH, birthdate, + new, birth = self.get_or_create_event(person, + EventType.BIRTH, birthdate, birthplace, birthsource) birth_ref = person.get_birth_ref() if birth_ref is None: @@ -703,8 +698,8 @@ if baptismsource is not None: new, baptismsource = self.get_or_create_source(baptismsource) if baptismdate or baptismplace or baptismsource: - new, baptism = self.get_or_create_event(person, - EventType.BAPTISM, baptismdate, + new, baptism = self.get_or_create_event(person, + EventType.BAPTISM, baptismdate, baptismplace, baptismsource) baptism_ref = get_primary_event_ref_from_type(self.db, person, "Baptism") @@ -751,8 +746,8 @@ if burialsource is not None: new, burialsource = self.get_or_create_source(burialsource) if burialdate or burialplace or burialsource: - new, burial = self.get_or_create_event(person, - EventType.BURIAL, burialdate, + new, burial = self.get_or_create_event(person, + EventType.BURIAL, burialdate, burialplace, burialsource) burial_ref = get_primary_event_ref_from_type(self.db, person, "Burial") @@ -786,8 +781,8 @@ place = self.create_place() if place_id is not None: if place_id.startswith("[") and place_id.endswith("]"): - place.gramps_id = self.db.id2user_format(place_id[1:-1]) - self.storeup("place", place_id.lower(), place) + place.gramps_id = self.db.pid2user_format(place_id[1:-1]) + self.storeup("place", place_id, place) if place_title is not None: place.title = place_title if place_name is not None: @@ -866,7 +861,7 @@ self.db.commit_person(wife, self.trans) self.fam_count += 1 return family - + def get_or_create_event(self, object_, type_, date=None, place=None, source=None): """ Add or find a type event on object """ @@ -903,7 +898,7 @@ self.find_and_set_citation(event, source) self.db.add_event(event, self.trans) return (1, event) - + def create_person(self): """ Used to create a new person we know doesn't exist """ person = Person() @@ -973,6 +968,6 @@ LOG.debug(" creating citation") citation.set_reference_handle(source.get_handle()) self.db.add_citation(citation, self.trans) - LOG.debug(" created citation, citation %s %s" % + LOG.debug(" created citation, citation %s %s" % (citation, citation.get_gramps_id())) obj.add_citation(citation.get_handle()) diff -Nru gramps-4.2.4~dfsg/gramps/plugins/importer/importprogen.py gramps-4.2.5~dfsg/gramps/plugins/importer/importprogen.py --- gramps-4.2.4~dfsg/gramps/plugins/importer/importprogen.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/importer/importprogen.py 2016-12-15 21:55:19.000000000 +0000 @@ -52,7 +52,7 @@ from gramps.gen.lib import (Attribute, AttributeType, ChildRef, Date, Event, EventRef, EventType, Family, FamilyRelType, Name, NameType, Note, NoteType, Person, Place, Source, - Surname, Citation, Location, NameOriginType) + SrcAttribute, Surname, Citation, Location, NameOriginType) from gramps.gen.db import DbTxn from gramps.gen.utils.libformatting import ImportInfo diff -Nru gramps-4.2.4~dfsg/gramps/plugins/importer/importvcard.py gramps-4.2.5~dfsg/gramps/plugins/importer/importvcard.py --- gramps-4.2.4~dfsg/gramps/plugins/importer/importvcard.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/importer/importvcard.py 2016-12-15 21:55:19.000000000 +0000 @@ -354,6 +354,7 @@ surname.set_surname(sname.strip()) surname.set_prefix(prefix.strip()) name.add_surname(surname) + name.set_primary_surname() if len(data_fields) > 1 and data_fields[1].strip(): given_name = ' '.join(self.unesc( diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/libgedcom.py gramps-4.2.5~dfsg/gramps/plugins/lib/libgedcom.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/libgedcom.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/libgedcom.py 2016-12-15 21:55:19.000000000 +0000 @@ -5,6 +5,7 @@ # Copyright (C) 2009-2010 Gary Burton # Copyright (C) 2010 Nick Hall # Copyright (C) 2011 Tim G L Lyons +# Copyright (C) 2016 Paul R. Culley # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -712,6 +713,7 @@ 'may' : 5, 'jun' : 6, 'jul' : 7, 'aug' : 8, 'sep' : 9, 'oct' : 10, 'nov' : 11, 'dec' : 12, } + fmt = "%m/%d/%y" #------------------------------------------------------------------------- # @@ -2958,12 +2960,11 @@ def __find_or_create_note(self, gramps_id): """ - Finds or creates a repository based on the GRAMPS ID. If the ID is + Finds or creates a note based on the GRAMPS ID. If the ID is already used (is in the db), we return the item in the db. Otherwise, - we create a new repository, assign the handle and GRAMPS ID. - - Some GEDCOM "flavors" destroy the specification, and declare the - repository inline instead of in a object. + we create a new note, assign the handle and GRAMPS ID. + If no GRAMPS ID is passed in, we not only make a Note with GID, we + commit it. """ note = Note() if not gramps_id: @@ -3522,7 +3523,7 @@ if self.use_def_src: repo.set_name(submitter_name) repo.set_handle(create_id()) - repo.set_gramps_id(self.dbase.find_next_repository_gramps_id()) + repo.set_gramps_id(self.rid_map[""]) addr = Address() addr.set_street(state.res.get_address()) @@ -3874,7 +3875,6 @@ """ self.__obje(line, state, state.person) - def __person_photo(self, line, state): """ This handles the FTM _PHOTO feature, which identifies an OBJE to use @@ -5224,7 +5224,6 @@ """ self.__obje(line, state, state.family) - def __family_comm(self, line, state): """ @param line: The current line in GedLine format @@ -5560,7 +5559,6 @@ """ self.__obje(line, state, state.event) - def __event_type(self, line, state): """ Parses the TYPE line for an event. @@ -5680,7 +5678,6 @@ """ self.__obje(line, state, state.place) - def __event_place_sour(self, line, state): """ @param line: The current line in GedLine format @@ -6318,7 +6315,7 @@ def __source_text(self, line, state): note = Note() note.set(line.data) - gramps_id = self.dbase.find_next_note_gramps_id() + gramps_id = self.nid_map[""] note.set_gramps_id(gramps_id) note.set_type(NoteType.SOURCE_TEXT) self.dbase.add_note(note, self.trans) @@ -6328,7 +6325,7 @@ def __citation_data_text(self, line, state): note = Note() note.set(line.data) - gramps_id = self.dbase.find_next_note_gramps_id() + gramps_id = self.nid_map[""] note.set_gramps_id(gramps_id) note.set_type(NoteType.SOURCE_TEXT) self.dbase.add_note(note, self.trans) @@ -6345,7 +6342,7 @@ line.data, [(0, len(line.data))]) note.set_styledtext(StyledText(line.data, [tags])) - gramps_id = self.dbase.find_next_note_gramps_id() + gramps_id = self.nid_map[""] note.set_gramps_id(gramps_id) note.set_type(NoteType.CITATION) self.dbase.add_note(note, self.trans) @@ -6358,7 +6355,7 @@ """ note = Note() note.set(line.data) - gramps_id = self.dbase.find_next_note_gramps_id() + gramps_id = self.nid_map[""] note.set_gramps_id(gramps_id) note.set_type(_("Citation Justification")) self.dbase.add_note(note, self.trans) @@ -6378,7 +6375,6 @@ """ self.__obje(line, state, state.citation) - def __citation_refn(self, line, state): """ Parses the REFN line of an SOUR instance tag @@ -6518,7 +6514,6 @@ """ self.__obje(line, state, state.source) - def __source_chan(self, line, state): """ @param line: The current line in GedLine format @@ -6566,7 +6561,7 @@ # This format has no repository name. See http://west- # penwith.org.uk/misc/ftmged.htm which points out this is # incorrect - gid = self.dbase.find_next_repository_gramps_id() + gid = self.rid_map[""] repo = self.__find_or_create_repository(gid) self.dbase.commit_repository(repo, self.trans) else: @@ -6580,7 +6575,7 @@ # non-standard GEDCOM. gid = self.repo2id.get(line.data) if gid is None: - gid = self.dbase.find_next_repository_gramps_id() + gid = self.rid_map[""] repo = self.__find_or_create_repository(gid) self.repo2id[line.data] = repo.get_gramps_id() repo.set_name(line.data) @@ -7758,7 +7753,7 @@ handle = self.inline_srcs.get(title, create_id()) src = Source() src.handle = handle - src.gramps_id = self.dbase.find_next_source_gramps_id() + src.gramps_id = self.sid_map[""] self.inline_srcs[title] = handle else: src = self.__find_or_create_source(self.sid_map[line.data]) diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/libmetadata.py gramps-4.2.5~dfsg/gramps/plugins/lib/libmetadata.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/libmetadata.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/libmetadata.py 2016-12-15 21:55:19.000000000 +0000 @@ -32,6 +32,8 @@ # #------------------------------------------------------------------------- from gi.repository import Gtk +import gi +gi.require_version('GExiv2', '0.10') from gi.repository import GExiv2 #------------------------------------------------------------------------- diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/maps/constants.py gramps-4.2.5~dfsg/gramps/plugins/lib/maps/constants.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/maps/constants.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/maps/constants.py 2016-12-15 21:55:19.000000000 +0000 @@ -28,6 +28,8 @@ from gramps.gen.lib import EventType import os from gramps.gen.const import HOME_DIR +import gi +gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap #------------------------------------------------------------------------- diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/maps/datelayer.py gramps-4.2.5~dfsg/gramps/plugins/lib/maps/datelayer.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/maps/datelayer.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/maps/datelayer.py 2016-12-15 21:55:19.000000000 +0000 @@ -60,6 +60,8 @@ #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/maps/dummylayer.py gramps-4.2.5~dfsg/gramps/plugins/lib/maps/dummylayer.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/maps/dummylayer.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/maps/dummylayer.py 2016-12-15 21:55:19.000000000 +0000 @@ -49,6 +49,8 @@ #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/maps/dummynogps.py gramps-4.2.5~dfsg/gramps/plugins/lib/maps/dummynogps.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/maps/dummynogps.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/maps/dummynogps.py 2016-12-15 21:55:19.000000000 +0000 @@ -49,6 +49,8 @@ #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/maps/geography.py gramps-4.2.5~dfsg/gramps/plugins/lib/maps/geography.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/maps/geography.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/maps/geography.py 2016-12-15 21:55:19.000000000 +0000 @@ -62,6 +62,8 @@ from gramps.gui.selectors.selectplace import SelectPlace from gramps.gen.constfunc import conv_to_unicode +import gi +gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap from . import constants from .osmgps import OsmGps @@ -403,7 +405,7 @@ import shutil path = "%s%c%s" % ( config.get('geography.path'), os.sep, the_map ) - shutil.rmtree(path) + shutil.rmtree(path, ignore_errors=True) pass def add_specific_menu(self, menu, event, lat, lon): diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/maps/kmllayer.py gramps-4.2.5~dfsg/gramps/plugins/lib/maps/kmllayer.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/maps/kmllayer.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/maps/kmllayer.py 2016-12-15 21:55:19.000000000 +0000 @@ -63,6 +63,8 @@ #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/maps/lifewaylayer.py gramps-4.2.5~dfsg/gramps/plugins/lib/maps/lifewaylayer.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/maps/lifewaylayer.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/maps/lifewaylayer.py 2016-12-15 21:55:19.000000000 +0000 @@ -59,6 +59,8 @@ #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/maps/markerlayer.py gramps-4.2.5~dfsg/gramps/plugins/lib/maps/markerlayer.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/maps/markerlayer.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/maps/markerlayer.py 2016-12-15 21:55:19.000000000 +0000 @@ -67,6 +67,8 @@ #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/maps/messagelayer.py gramps-4.2.5~dfsg/gramps/plugins/lib/maps/messagelayer.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/maps/messagelayer.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/maps/messagelayer.py 2016-12-15 21:55:19.000000000 +0000 @@ -60,6 +60,8 @@ #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/maps/osmgps.py gramps-4.2.5~dfsg/gramps/plugins/lib/maps/osmgps.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/maps/osmgps.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/maps/osmgps.py 2016-12-15 21:55:19.000000000 +0000 @@ -72,6 +72,8 @@ #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff -Nru gramps-4.2.4~dfsg/gramps/plugins/lib/maps/selectionlayer.py gramps-4.2.5~dfsg/gramps/plugins/lib/maps/selectionlayer.py --- gramps-4.2.4~dfsg/gramps/plugins/lib/maps/selectionlayer.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/lib/maps/selectionlayer.py 2016-12-15 21:55:19.000000000 +0000 @@ -50,6 +50,8 @@ #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff -Nru gramps-4.2.4~dfsg/gramps/plugins/rel/rel_no.py gramps-4.2.5~dfsg/gramps/plugins/rel/rel_no.py --- gramps-4.2.4~dfsg/gramps/plugins/rel/rel_no.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/rel/rel_no.py 2016-12-15 21:55:19.000000000 +0000 @@ -41,10 +41,10 @@ _cousin_level = [ "", "", #brother/sister, fetter/kusine -- these are taken care of separately "tremenning", "firemenning", "femmenning", "seksmenning", "sjumenning", "åttemenning", -"nimenning", "timenning", "elvemenning", +"nimenning", "timenning", "ellevemenning", "tolvmenning", "tretenmenning", "fjortenmenning", "femtenmenning", "sekstenmenning", "syttenmenning", -"attenmenning", "nittenmenning", "tyvemenning" ] +"attenmenning", "nittenmenning", "tjuemenning" ] _cousin_terms = _cousin_level + ["fetter", "kusine"] #------------------------------------------------------------------------- diff -Nru gramps-4.2.4~dfsg/gramps/plugins/tool/check.py gramps-4.2.5~dfsg/gramps/plugins/tool/check.py --- gramps-4.2.4~dfsg/gramps/plugins/tool/check.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/tool/check.py 2016-12-15 21:55:19.000000000 +0000 @@ -1923,6 +1923,76 @@ elif item[1] not in known_handles: self.invalid_tag_references.add(item[1]) + for bhandle in self.db.get_event_handles(): + self.progress.step() + event = self.db.get_event_from_handle(bhandle) + handle_list = event.get_referenced_handles_recursively() + for item in handle_list: + if item[0] == 'Tag': + if item[1] is None: + new_handle = create_id() + event.replace_tag_references(None, new_handle) + self.db.commit_event(event, self.trans) + self.invalid_tag_references.add(new_handle) + elif item[1] not in known_handles: + self.invalid_tag_references.add(item[1]) + + for bhandle in self.db.get_citation_handles(): + self.progress.step() + citation = self.db.get_citation_from_handle(bhandle) + handle_list = citation.get_referenced_handles_recursively() + for item in handle_list: + if item[0] == 'Tag': + if item[1] is None: + new_handle = create_id() + citation.replace_tag_references(None, new_handle) + self.db.commit_citation(citation, self.trans) + self.invalid_tag_references.add(new_handle) + elif item[1] not in known_handles: + self.invalid_tag_references.add(item[1]) + + for bhandle in self.db.get_source_handles(): + self.progress.step() + source = self.db.get_source_from_handle(bhandle) + handle_list = source.get_referenced_handles_recursively() + for item in handle_list: + if item[0] == 'Tag': + if item[1] is None: + new_handle = create_id() + source.replace_tag_references(None, new_handle) + self.db.commit_source(source, self.trans) + self.invalid_tag_references.add(new_handle) + elif item[1] not in known_handles: + self.invalid_tag_references.add(item[1]) + + for bhandle in self.db.get_place_handles(): + self.progress.step() + place = self.db.get_place_from_handle(bhandle) + handle_list = place.get_referenced_handles_recursively() + for item in handle_list: + if item[0] == 'Tag': + if item[1] is None: + new_handle = create_id() + place.replace_tag_references(None, new_handle) + self.db.commit_place(place, self.trans) + self.invalid_tag_references.add(new_handle) + elif item[1] not in known_handles: + self.invalid_tag_references.add(item[1]) + + for bhandle in self.db.get_repository_handles(): + self.progress.step() + repository = self.db.get_repository_from_handle(bhandle) + handle_list = repository.get_referenced_handles_recursively() + for item in handle_list: + if item[0] == 'Tag': + if item[1] is None: + new_handle = create_id() + repository.replace_tag_references(None, new_handle) + self.db.commit_repository(repository, self.trans) + self.invalid_tag_references.add(new_handle) + elif item[1] not in known_handles: + self.invalid_tag_references.add(item[1]) + for bad_handle in self.invalid_tag_references: make_unknown(bad_handle, None, self.class_tag, self.commit_tag, self.trans) @@ -1950,6 +2020,7 @@ source = Source() source.unserialize(info) new_media_ref_list = [] + citation_changed = False for media_ref in source.get_media_list(): citation_list = media_ref.get_citation_list() new_citation_list = [] @@ -1972,6 +2043,7 @@ citation_handle = create_id() new_citation.set_handle(citation_handle) self.replaced_sourceref.append(handle) + citation_changed = True logging.warning(' FAIL: the source "%s" has a media ' 'reference with a source citation ' 'which is invalid' % (source.gramps_id)) @@ -1982,8 +2054,9 @@ media_ref.set_citation_list(new_citation_list) new_media_ref_list.append(media_ref) - source.set_media_list(new_media_ref_list) - self.db.commit_source(source, self.trans) + if citation_changed: + source.set_media_list(new_media_ref_list) + self.db.commit_source(source, self.trans) if len(self.replaced_sourceref) > 0: logging.info(' OK: no broken source citations on mediarefs found') diff -Nru gramps-4.2.4~dfsg/gramps/plugins/view/geography.gpr.py gramps-4.2.5~dfsg/gramps/plugins/view/geography.gpr.py --- gramps-4.2.4~dfsg/gramps/plugins/view/geography.gpr.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/view/geography.gpr.py 2016-12-15 21:55:19.000000000 +0000 @@ -44,6 +44,8 @@ if repository.enumerate_versions("OsmGpsMap"): try : # current osmgpsmap support GTK3 + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap if osmgpsmap._version < '0.8': _LOG.warning( _("OsmGpsMap module not loaded. " diff -Nru gramps-4.2.4~dfsg/gramps/plugins/webreport/narrativeweb.py gramps-4.2.5~dfsg/gramps/plugins/webreport/narrativeweb.py --- gramps-4.2.4~dfsg/gramps/plugins/webreport/narrativeweb.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/plugins/webreport/narrativeweb.py 2016-12-15 21:55:19.000000000 +0000 @@ -652,7 +652,7 @@ @param: place_lat_long -- for use in Family Map Pages. This will be None if called from Family pages, which do not create a Family Map """ - family_list = sorted(individual.get_family_handle_list()) + family_list = individual.get_family_handle_list() if not family_list: return None @@ -3195,9 +3195,11 @@ for person_handle in sorted(handle_list, key=lambda x: sort_on_name_and_grampsid(x, self.dbase_)): person = self.dbase_.get_person_from_handle(person_handle) if person: - family_list = sorted(pers_fam_dict[person_handle], key=lambda x:x.get_gramps_id()) + family_list = person.get_family_handle_list() first_family = True - for family in family_list: + for family_handle in family_list: + family = self.dbase_.get_family_from_handle(family_handle) + trow = Html("tr") tbody += trow diff -Nru gramps-4.2.4~dfsg/gramps/version.py gramps-4.2.5~dfsg/gramps/version.py --- gramps-4.2.4~dfsg/gramps/version.py 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/gramps/version.py 2016-12-15 21:55:19.000000000 +0000 @@ -18,6 +18,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -VERSION_TUPLE = (4, 2, 4) +VERSION_TUPLE = (4, 2, 5) VERSION = '.'.join(map(str,VERSION_TUPLE)) major_version = "%s.%s" % (VERSION_TUPLE[0], VERSION_TUPLE[1]) diff -Nru gramps-4.2.4~dfsg/mac/gramps.bundle gramps-4.2.5~dfsg/mac/gramps.bundle --- gramps-4.2.4~dfsg/mac/gramps.bundle 2016-09-04 14:44:02.000000000 +0000 +++ gramps-4.2.5~dfsg/mac/gramps.bundle 2016-12-15 21:55:19.000000000 +0000 @@ -13,7 +13,7 @@ ${project}/Info.plist