From 78b5fba3585d35072f3e98234744f9b87911c95a Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Fri, 19 Feb 2016 19:40:27 +0100 Subject: [PATCH 01/12] 3068: Wrong reference number for "same person as" in detailed descendant report --- gramps/plugins/textreport/detdescendantreport.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gramps/plugins/textreport/detdescendantreport.py b/gramps/plugins/textreport/detdescendantreport.py index 94c1f4cae..ea0ef66f4 100644 --- a/gramps/plugins/textreport/detdescendantreport.py +++ b/gramps/plugins/textreport/detdescendantreport.py @@ -195,7 +195,11 @@ class DetDescendantReport(Report): def apply_henry_filter(self,person_handle, index, pid, cur_gen=1): if (not person_handle) or (cur_gen > self.max_generations): return - self.dnumber[person_handle] = pid + if person_handle in self.dnumber: + if self.dnumber[person_handle] > pid: + self.dnumber[person_handle] = pid + else: + self.dnumber[person_handle] = pid self.map[index] = person_handle if len(self.gen_keys) < cur_gen: From 7c45e78e95e4197b8a6155152c00fc39f049bf9c Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 22 May 2016 12:42:32 -0400 Subject: [PATCH 02/12] 8466: [Performance] Handling many Events on a person --- gramps/plugins/gramplet/events.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gramps/plugins/gramplet/events.py b/gramps/plugins/gramplet/events.py index 4a9ec8ce0..8c371559c 100644 --- a/gramps/plugins/gramplet/events.py +++ b/gramps/plugins/gramplet/events.py @@ -93,7 +93,7 @@ class Events(Gramplet, DbGUIElement): event = self.dbstate.db.get_event_from_handle(event_ref.ref) event_date = get_date(event) event_sort = '%012d' % event.get_date_object().get_sort_value() - person_age = self.column_age(event) + person_age = self.column_age(event) person_age_sort = self.column_sort_age(event) place = place_displayer.display_event(self.dbstate.db, event) @@ -118,7 +118,7 @@ class Events(Gramplet, DbGUIElement): month, days" """ date = event.get_date_object() - start_date = self.get_start_date() + start_date = self.cached_start_date if date and start_date: return (date - start_date).format(precision=age_precision) else: @@ -129,7 +129,7 @@ class Events(Gramplet, DbGUIElement): Returns a string version of number of days of age. """ date = event.get_date_object() - start_date = self.get_start_date() + start_date = self.cached_start_date if date and start_date: return "%09d" % int(date - start_date) else: @@ -171,6 +171,7 @@ class PersonEvents(Events): Return True if the gramplet has data, else return False. """ if active_person: + self.cached_start_date = self.get_start_date() if active_person.get_event_ref_list(): return True for family_handle in active_person.get_family_handle_list(): @@ -178,6 +179,8 @@ class PersonEvents(Events): if family: for event_ref in family.get_event_ref_list(): return True + else: + self.cached_start_date = None return False def main(self): # return false finishes From 10629b16b8c3945efb68cd763691b2bef4088180 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 22 May 2016 17:54:23 +0100 Subject: [PATCH 03/12] 8785: Expand tree in selectors automatically --- gramps/gui/selectors/baseselector.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/gramps/gui/selectors/baseselector.py b/gramps/gui/selectors/baseselector.py index ac6601301..59014af40 100644 --- a/gramps/gui/selectors/baseselector.py +++ b/gramps/gui/selectors/baseselector.py @@ -132,18 +132,6 @@ class BaseSelector(ManagedWindow): """ iter_ = self.model.get_iter_from_handle(handle) if iter_: - if not (self.model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY): - # Expand tree - parent_iter = self.model.iter_parent(iter_) - if parent_iter: - parent_path = self.model.get_path(parent_iter) - if parent_path: - parent_path_list = parent_path.get_indices() - for i in range(len(parent_path_list)): - expand_path = Gtk.TreePath( - tuple([x for x in parent_path_list[:i+1]])) - self.tree.expand_row(expand_path, False) - # Select active object path = self.model.get_path(iter_) self.selection.unselect_all() @@ -300,6 +288,9 @@ class BaseSelector(ManagedWindow): self.setupcols = False + 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: self.sortorder = Gtk.SortType.ASCENDING From 151677fb7ef58e4cf9dc78da366909879e770083 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 22 May 2016 18:26:34 +0100 Subject: [PATCH 04/12] 9314: Allow place selection both individually and by filter Add the places selected individually to the list generated by the filter. --- gramps/plugins/textreport/placereport.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gramps/plugins/textreport/placereport.py b/gramps/plugins/textreport/placereport.py index 7090179c9..97d39d304 100644 --- a/gramps/plugins/textreport/placereport.py +++ b/gramps/plugins/textreport/placereport.py @@ -107,13 +107,15 @@ class PlaceReport(Report): self.sort = Sort(self.database) + self.place_handles = [] if self.filter.get_name() != '': # Use the selected filter to provide a list of place handles plist = self.database.iter_place_handles() self.place_handles = self.filter.apply(self.database, plist) - else: - # Use the place handles selected without a filter - self.place_handles = self.__get_place_handles(places) + + if places: + # Add places selected individually + self.place_handles += self.__get_place_handles(places) if not self.place_handles: raise ReportError(_('Place Report'), From 443043a8e273b6571dadaedf17cd82c8d95869e4 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 22 May 2016 19:07:35 +0100 Subject: [PATCH 05/12] 9466: Include all place types in place report --- gramps/plugins/textreport/placereport.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/gramps/plugins/textreport/placereport.py b/gramps/plugins/textreport/placereport.py index 97d39d304..b1ff09b67 100644 --- a/gramps/plugins/textreport/placereport.py +++ b/gramps/plugins/textreport/placereport.py @@ -46,7 +46,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, FONT_SANS_SERIF, FONT_SERIF, INDEX_TYPE_TOC, PARA_ALIGN_CENTER) from gramps.gen.sort import Sort -from gramps.gen.utils.location import get_main_location +from gramps.gen.utils.location import get_location_list from gramps.gen.display.place import displayer as place_displayer from gramps.gen.lib import PlaceType from gramps.gen.errors import ReportError @@ -171,17 +171,12 @@ class PlaceReport(Report): This procedure writes out the details of a single place """ place = self.database.get_place_from_handle(handle) - location = get_main_location(self.database, place) - place_details = [ - self._("Gramps ID: %s ") % place.get_gramps_id(), - self._("Street: %s ") % location.get(PlaceType.STREET, ''), - self._("Parish: %s ") % location.get(PlaceType.PARISH, ''), - self._("Locality: %s ") % location.get(PlaceType.LOCALITY, ''), - self._("City: %s ") % location.get(PlaceType.CITY, ''), - self._("County: %s ") % location.get(PlaceType.COUNTY, ''), - self._("State: %s") % location.get(PlaceType.STATE, ''), - self._("Country: %s ") % location.get(PlaceType.COUNTRY, '')] + place_details = [self._("Gramps ID: %s ") % place.get_gramps_id()] + for level in get_location_list(self.database, place): + place_details.append("%(type)s: %(name)s " % + {'type': str(level[1]), 'name': level[0]}) + place_names = '' all_names = place.get_all_names() if len(all_names) > 1 or __debug__: From 05ea21690dd10ca92377c5c4ea66e9e745f5ffcd Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 22 May 2016 22:50:19 +0100 Subject: [PATCH 06/12] Fix to allow deferred translation of place type --- gramps/plugins/textreport/placereport.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gramps/plugins/textreport/placereport.py b/gramps/plugins/textreport/placereport.py index b1ff09b67..4a6ef880d 100644 --- a/gramps/plugins/textreport/placereport.py +++ b/gramps/plugins/textreport/placereport.py @@ -175,7 +175,8 @@ class PlaceReport(Report): place_details = [self._("Gramps ID: %s ") % place.get_gramps_id()] for level in get_location_list(self.database, place): place_details.append("%(type)s: %(name)s " % - {'type': str(level[1]), 'name': level[0]}) + {'type': self._(level[1].xml_str()), + 'name': level[0]}) place_names = '' all_names = place.get_all_names() From f5233fbe7c6d11c4cd1c57241080c5ad7bc70e98 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Mon, 23 May 2016 11:06:54 +0200 Subject: [PATCH 07/12] 9075: Saving/closing new person window with Alt-o does not find gender --- gramps/gui/editors/editperson.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gramps/gui/editors/editperson.py b/gramps/gui/editors/editperson.py index 8f16d47fb..9fa3a6336 100644 --- a/gramps/gui/editors/editperson.py +++ b/gramps/gui/editors/editperson.py @@ -245,7 +245,7 @@ class EditPerson(EditPrimary): WIKI_HELP_PAGE, _('manual|Editing_information_about_people')) - self.given.connect("focus_out_event", self._given_focus_out_event) + self.given.connect("focus-out-event", self._given_focus_out_event) self.top.get_object("editnamebtn").connect("clicked", self._edit_name_clicked) self.top.get_object("multsurnamebtn").connect("clicked", From 6c2eac9e050537975f87610c77fba609c68d7f0c Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Mon, 23 May 2016 15:20:37 +0100 Subject: [PATCH 08/12] 9427: Add inclusive option to IsEnclosedBy rule --- gramps/gen/filters/_filterparser.py | 3 +++ gramps/gen/filters/rules/place/_isenclosedby.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gramps/gen/filters/_filterparser.py b/gramps/gen/filters/_filterparser.py index 42cdd4212..a59b55cf8 100644 --- a/gramps/gen/filters/_filterparser.py +++ b/gramps/gen/filters/_filterparser.py @@ -166,6 +166,9 @@ class FilterParser(handler.ContentHandler): # HasEvent rule has extra primary role field in v3.4.7 if self.r == rules.person.HasEvent and len(self.a) == 5: self.a.append('1') + # IsEnclosedBy rule has extra inclusive field in v4.2.4 + if self.r == rules.place.IsEnclosedBy and len(self.a) == 1: + self.a.append('0') #------------------------------------------------------------------------- # diff --git a/gramps/gen/filters/rules/place/_isenclosedby.py b/gramps/gen/filters/rules/place/_isenclosedby.py index 6c445ebf0..c6408b1ed 100644 --- a/gramps/gen/filters/rules/place/_isenclosedby.py +++ b/gramps/gen/filters/rules/place/_isenclosedby.py @@ -45,7 +45,7 @@ class IsEnclosedBy(Rule): Rule that checks for a place enclosed by another place """ - labels = [_('ID:')] + labels = [_('ID:'), _('Inclusive:')] name = _('Places enclosed by another place') description = _('Matches a place enclosed by a particular place') category = _('General filters') @@ -59,6 +59,8 @@ class IsEnclosedBy(Rule): def apply(self, db, place): if self.handle is None: return False + if self.list[1] == '1' and place.handle == self.handle: + return True if located_in(db, place.handle, self.handle): return True return False From 7d2a7b71d04da2af6d30ec5c61a2b5651f521942 Mon Sep 17 00:00:00 2001 From: prculley Date: Tue, 24 May 2016 08:56:19 -0500 Subject: [PATCH 09/12] bug 9459 GEDCOM import in CLI mode with .ged file containing ANSEL encoding tries to pop up gui --- gramps/plugins/importer/importgedcom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gramps/plugins/importer/importgedcom.py b/gramps/plugins/importer/importgedcom.py index 4a2b5a1df..482589b23 100644 --- a/gramps/plugins/importer/importgedcom.py +++ b/gramps/plugins/importer/importgedcom.py @@ -88,7 +88,7 @@ def importData(database, filename, user): except IOError: return - if not gramps and ansel: + if not gramps and ansel and user.uistate: top = Glade() code = top.get_object('codeset') code.set_active(0) From 4413c7c88bbf79738ff8aef61261acd11813da87 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 24 May 2016 16:15:46 +0100 Subject: [PATCH 10/12] Add extra unit test for IsEnclosedBy rule --- gramps/gen/filters/rules/test/place_rules_test.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gramps/gen/filters/rules/test/place_rules_test.py b/gramps/gen/filters/rules/test/place_rules_test.py index e2e09a5ae..145790868 100644 --- a/gramps/gen/filters/rules/test/place_rules_test.py +++ b/gramps/gen/filters/rules/test/place_rules_test.py @@ -207,12 +207,23 @@ class BaseTest(unittest.TestCase): """ Test IsEnclosedBy rule. """ - rule = IsEnclosedBy(['P0001']) + rule = IsEnclosedBy(['P0001', '0']) self.assertEqual(self.filter_with_rule(rule), set([ b'EAFKQCR0ED5QWL87EO', b'S22LQCLUZM135LVKRL', b'VDUJQCFP24ZV3O4ID2', b'V6ALQCZZFN996CO4D', b'OC6LQCXMKP6NUVYQD8', b'CUUKQC6BY5LAZXLXC6', b'PTFKQCKPHO2VC5SYKS', b'PHUJQCJ9R4XQO5Y0WS'])) + def test_isenclosedby_inclusive(self): + """ + Test IsEnclosedBy rule with inclusive option. + """ + rule = IsEnclosedBy(['P0001', '1']) + self.assertEqual(self.filter_with_rule(rule), set([ + b'c96587262e91149933fcea5f20a', b'EAFKQCR0ED5QWL87EO', + b'S22LQCLUZM135LVKRL', b'VDUJQCFP24ZV3O4ID2', b'V6ALQCZZFN996CO4D', + b'OC6LQCXMKP6NUVYQD8', b'CUUKQC6BY5LAZXLXC6', b'PTFKQCKPHO2VC5SYKS', + b'PHUJQCJ9R4XQO5Y0WS'])) + if __name__ == "__main__": unittest.main() From f92c35d7976ec5aa25e9fac799be58731a15b6f6 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Tue, 24 May 2016 12:14:33 -0400 Subject: [PATCH 11/12] Merge pull request #157 from prculley/bug7949 Bug 7949, crash on GEDCOM import with empty _AKA lines --- gramps/plugins/lib/libgedcom.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index 3856af636..cfdde921d 100755 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -4344,6 +4344,8 @@ class GedcomParser(UpdateCallback): attr.set_type(AttributeType.NICKNAME) attr.set_value(line.data) state.person.add_attribute(attr) + elif name_len == 0: + return else: name = Name() surname = Surname() From 7851d3bdfbba3be7e4d87657cd9839dbde747f6a Mon Sep 17 00:00:00 2001 From: Ben Woods Date: Sun, 7 Feb 2016 14:19:24 +0100 Subject: [PATCH 12/12] Fix setup.py to remove the double '/' when building man pages This was resulting in 'share/man//...' showing in the file list generated for system packages. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 778e3c8df..414779f63 100755 --- a/setup.py +++ b/setup.py @@ -180,8 +180,8 @@ def build_man(build_cmd): filename = False lang = man_dir[8:] - src = build_cmd.build_base + '/data/man/' + lang + '/gramps.1.gz' - target = 'share/man/' + lang + '/man1' + src = build_cmd.build_base + '/data/man' + lang + '/gramps.1.gz' + target = 'share/man' + lang + '/man1' data_files.append((target, [src])) def build_intl(build_cmd):