diff --git a/README.md b/README.md index c2fc42348..c2dccf476 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ The following packages are **STRONGLY RECOMMENDED** to be installed: Used to show maps in the geography view. It may be osmgpsmap, osm-gps-map, or python-osmgpsmap, - but the Python bindings for this must also be present. + but the Python bindings for this must also be present, so gir1.2-osmgpsmap-1.0. Without this the GeoView will not be active, see https://gramps-project.org/wiki/index.php?title=Gramps_4.2_Wiki_Manual_-_Categories#Geography_Category @@ -50,7 +50,7 @@ The following packages are **STRONGLY RECOMMENDED** to be installed: Enable creation of graphs using Graphviz engine. Without this, three reports cannot be run. - Obtain it from: http://www.graphviz.org + Obtain it from: http://www.graphviz.org or try graphviz and python3-pygraphviz from your packages. * **PyICU** @@ -109,7 +109,7 @@ Prerequistes required for the following Addons to work: * **Family Sheet** - Requires: PIL (Python Imaging Library) or PILLOW. ( https://gramps-project.org/wiki/index.php?title=Family_Sheet ) -* **Graph View** - Requires: PyGoocanvas and Goocanvas. +* **Graph View** - Requires: PyGoocanvas and Goocanvas (python-pygoocanvas, gir1.2-goocanvas-2.0). ( https://gramps-project.org/wiki/index.php?title=Graph_View ) * **PedigreeChart** - Can optionally use - numpy if installed diff --git a/gramps/gen/datehandler/_date_cs.py b/gramps/gen/datehandler/_date_cs.py index 7911053a4..6b345f969 100644 --- a/gramps/gen/datehandler/_date_cs.py +++ b/gramps/gen/datehandler/_date_cs.py @@ -49,145 +49,15 @@ class DateParserCZ(DateParser): """ Converts a text string into a Date object """ - month_to_int = DateParser.month_to_int - month_to_int["leden"] = 1 - month_to_int["ledna"] = 1 - month_to_int["lednu"] = 1 - month_to_int["led"] = 1 - month_to_int["I"] = 1 - month_to_int["i"] = 1 - - month_to_int["únor"] = 2 - month_to_int["února"] = 2 - month_to_int["únoru"] = 2 - month_to_int["ún"] = 2 - month_to_int["II"] = 2 - month_to_int["ii"] = 2 - - month_to_int["březen"] = 3 - month_to_int["března"] = 3 - month_to_int["březnu"] = 3 - month_to_int["bře"] = 3 - month_to_int["III"] = 3 - month_to_int["iii"] = 3 - - month_to_int["duben"] = 4 - month_to_int["dubna"] = 4 - month_to_int["dubnu"] = 4 - month_to_int["dub"] = 4 - month_to_int["IV"] = 4 - month_to_int["iv"] = 4 - - month_to_int["květen"] = 5 - month_to_int["května"] = 5 - month_to_int["květnu"] = 5 - month_to_int["V"] = 5 - month_to_int["v"] = 5 - - month_to_int["červen"] = 6 - month_to_int["června"] = 6 - month_to_int["červnu"] = 6 - month_to_int["čer"] = 6 - month_to_int["vi"] = 6 - - month_to_int["červenec"] = 7 - month_to_int["července"] = 7 - month_to_int["červenci"] = 7 - month_to_int["čvc"] = 7 - month_to_int["VII"] = 7 - month_to_int["vii"] = 7 - - month_to_int["srpen"] = 8 - month_to_int["srpna"] = 8 - month_to_int["srpnu"] = 8 - month_to_int["srp"] = 8 - month_to_int["VIII"] = 8 - month_to_int["viii"] = 8 - - month_to_int["září"] = 9 - month_to_int["zář"] = 9 - month_to_int["IX"] = 9 - month_to_int["ix"] = 9 - - month_to_int["říjen"] = 10 - month_to_int["října"] = 10 - month_to_int["říjnu"] = 10 - month_to_int["říj"] = 10 - month_to_int["X"] = 10 - month_to_int["x"] = 10 - - month_to_int["listopad"] = 11 - month_to_int["listopadu"] = 11 - month_to_int["lis"] = 11 - month_to_int["XI"] = 11 - month_to_int["xi"] = 11 - - month_to_int["prosinec"] = 12 - month_to_int["prosince"] = 12 - month_to_int["prosinci"] = 12 - month_to_int["pro"] = 12 - month_to_int["XII"] = 12 - month_to_int["xii"] = 12 - - modifier_to_int = { - 'před' : Date.MOD_BEFORE, - 'do' : Date.MOD_BEFORE, - 'po' : Date.MOD_AFTER, - 'asi' : Date.MOD_ABOUT, - 'kolem' : Date.MOD_ABOUT, - 'přibl.' : Date.MOD_ABOUT, - } - - calendar_to_int = { - 'gregoriánský' : Date.CAL_GREGORIAN, - 'greg.' : Date.CAL_GREGORIAN, - 'g' : Date.CAL_GREGORIAN, - 'juliánský' : Date.CAL_JULIAN, - 'jul.' : Date.CAL_JULIAN, - 'j' : Date.CAL_JULIAN, - 'hebrejský' : Date.CAL_HEBREW, - 'hebr.' : Date.CAL_HEBREW, - 'h' : Date.CAL_HEBREW, - 'islámský' : Date.CAL_ISLAMIC, - 'isl.' : Date.CAL_ISLAMIC, - 'i' : Date.CAL_ISLAMIC, - 'francouzský republikánský' : Date.CAL_FRENCH, - 'fr.' : Date.CAL_FRENCH, - 'perský' : Date.CAL_PERSIAN, - 'per.' : Date.CAL_PERSIAN, - 'p' : Date.CAL_PERSIAN, - 'švédský' : Date.CAL_SWEDISH, - 'sve.' : Date.CAL_SWEDISH, - 's' : Date.CAL_SWEDISH, - } - - quality_to_int = { - 'přibližně' : Date.QUAL_ESTIMATED, - 'odhadem' : Date.QUAL_ESTIMATED, - 'odh.' : Date.QUAL_ESTIMATED, - 'vypočteno' : Date.QUAL_CALCULATED, - 'vypočtené' : Date.QUAL_CALCULATED, - 'vyp.' : Date.QUAL_CALCULATED, - } + bce = ["před naším letopočtem", "před Kristem", + "př. n. l.", "př. Kr."] + DateParser.bce def dhformat_changed(self): """ Allow overriding so a subclass can modify it """ # bug 9739 grampslocale.py gets '%-d.%-m.%Y' -- makes it be '%/d.%/m.%Y' self.dhformat = self.dhformat.replace('/', '') # so counteract that - def init_strings(self): - DateParser.init_strings(self) - self._text2 = re.compile('(\d+)?\.?\s+?%s\.?\s*((\d+)(/\d+)?)?\s*$' - % self._mon_str, re.IGNORECASE) - self._span = re.compile( - "(od)\s+(?P.+)\s+(do)\s+(?P.+)", - re.IGNORECASE) - self._range = re.compile( - "(mezi)\s+(?P.+)\s+(a)\s+(?P.+)", - re.IGNORECASE) - - #------------------------------------------------------------------------- # # Czech display @@ -197,25 +67,6 @@ class DateDisplayCZ(DateDisplay): """ Czech language date display class. """ - long_months = ( "", "leden", "únor", "březen", "duben", "květen", - "červen", "červenec", "srpen", "září", "říjen", - "listopad", "prosinec" ) - - short_months = ( "", "led", "úno", "bře", "dub", "kvě", "čer", - "čvc", "srp", "zář", "říj", "lis", "pro" ) - - calendar = ( - "", "juliánský", "hebrejský", - "francouzský republikánský", "perský", "islámský", - "švédský" - ) - - _mod_str = ("", "před ", "po ", "kolem ", "", "", "") - - _qual_str = ("", "přibližně ", "vypočteno ") - - bce = ["před naším letopočtem", "před Kristem", - "př. n. l.", "př. Kr."] + DateParser.bce display = DateDisplay.display_formatted @@ -225,58 +76,6 @@ class DateDisplayCZ(DateDisplay): # bug 9537 grampslocale.py gets '%-d.%-m.%Y' -- makes it be '%/d.%/m.%Y' self.dhformat = self.dhformat.replace('/', '') # so counteract that - self.formats = ( - "ISO (rrrr-mm-dd)", - "numerický", - "měsíc den, Rok", - "měs den, Rok", - "den. měsíc rok", - "den. měs rok" - ) - # this must agree with DateDisplayEn's "formats" definition - # (since no locale-specific _display_gregorian exists, here) - - def orig_display(self, date): # unused: only here for historical reference - """ - Return a text string representing the date. - """ - mod = date.get_modifier() - cal = date.get_calendar() - qual = date.get_quality() - start = date.get_start_date() - newyear = date.get_new_year() - - qual_str = self._qual_str[qual] - - if mod == Date.MOD_TEXTONLY: - return date.get_text() - elif start == Date.EMPTY: - return "" -# elif mod == Date.MOD_NONE: -# date_decl_string = self.display_cal[cal](start) -# date_decl_string = date_decl_string.replace("den ", "dna ") -# date_decl_string = date_decl_string.replace("or ", "ora ") -# date_decl_string = date_decl_string.replace("en ", "na ") -# date_decl_string = date_decl_string.replace("ad ", "adu ") -# date_decl_string = date_decl_string.replace("ec ", "ce ") -# return date_decl_string - elif mod == Date.MOD_SPAN: - dat1 = self.display_cal[cal](start) - dat2 = self.display_cal[cal](date.get_stop_date()) - scal = self.format_extras(cal, newyear) - return "%s%s %s %s %s%s" % (qual_str, 'od', dat1, - 'do', dat2, scal) - elif mod == Date.MOD_RANGE: - dat1 = self.display_cal[cal](start) - dat2 = self.display_cal[cal](date.get_stop_date()) - scal = self.format_extras(cal, newyear) - return "%s%s %s %s %s%s" % (qual_str, 'mezi', - dat1, 'a', dat2, scal) - else: - text = self.display_cal[date.get_calendar()](start) - scal = self.format_extras(cal, newyear) - return "%s%s%s%s" % (qual_str, self._mod_str[mod], - text, scal) #------------------------------------------------------------------------- # diff --git a/gramps/gen/lib/date.py b/gramps/gen/lib/date.py index d7e9e9892..5f4a63369 100644 --- a/gramps/gen/lib/date.py +++ b/gramps/gen/lib/date.py @@ -1765,9 +1765,9 @@ class Date: """ Return True if the date contains no information (empty text). """ - return (self.modifier == Date.MOD_TEXTONLY and not self.text) or \ - (self.get_start_date() == Date.EMPTY - and self.get_stop_date() == Date.EMPTY) + return not((self.modifier == Date.MOD_TEXTONLY and self.text) + or self.get_start_date() != Date.EMPTY + or self.get_stop_date() != Date.EMPTY) def is_compound(self): """ diff --git a/gramps/gen/lib/test/date_test.py b/gramps/gen/lib/test/date_test.py index c6a6611e1..d4312637b 100644 --- a/gramps/gen/lib/test/date_test.py +++ b/gramps/gen/lib/test/date_test.py @@ -536,5 +536,42 @@ class Test_set_newyear(BaseDateTest): except DateError: self.assertTrue(should_raise, message) +#------------------------------------------------------------------------- +# +# EmptyDateTest +# +#------------------------------------------------------------------------- +class EmptyDateTest(BaseDateTest): + """ + Tests for empty dates. + """ + def test_empty(self): + d = Date() + self.assertTrue(d.is_empty()) + + def test_text_only_empty(self): + d = Date() + d.set(text='First of Jan', + modifier=Date.MOD_TEXTONLY) + self.assertFalse(d.is_empty()) + + def test_single_empty(self): + d = Date() + d.set(value=(1, 1, 1900, False), + modifier=Date.MOD_NONE) + self.assertFalse(d.is_empty()) + + def test_range_empty(self): + d = Date() + d.set(value=(1, 1, 1900, False, 1, 1, 1910, False), + modifier=Date.MOD_RANGE) + self.assertFalse(d.is_empty()) + + def test_span_empty(self): + d = Date() + d.set(value=(1, 1, 1900, False, 1, 1, 1910, False), + modifier=Date.MOD_SPAN) + self.assertFalse(d.is_empty()) + if __name__ == "__main__": unittest.main() diff --git a/gramps/gui/clipboard.py b/gramps/gui/clipboard.py index 79f41d5b8..9ea72cd76 100644 --- a/gramps/gui/clipboard.py +++ b/gramps/gui/clipboard.py @@ -1314,54 +1314,57 @@ class ClipboardListView: # Just select the first match. wrapper_class = self._target_type_to_wrapper_class_map[ str(possible_wrappers[0])] - o = wrapper_class(self.dbstate, sel_data) - if title: - o._title = title - if value: - o._value = value - if dbid: - o._dbid = dbid - if dbname: - o._dbname = dbname + try: + o = wrapper_class(self.dbstate, sel_data) + if title: + o._title = title + if value: + o._value = value + if dbid: + o._dbid = dbid + if dbname: + o._dbname = dbname - # If the wrapper object is a subclass of ClipDropList then - # the drag data was a list of objects and we need to decode - # all of them. - if isinstance(o,ClipDropList): - o_list = o.get_objects() - else: - o_list = [o] - for o in o_list: - if o.__class__.DRAG_TARGET is None: - continue - data = [o.__class__.DRAG_TARGET.drag_type, o, None, - o._type, o._value, o._dbid, o._dbname] - contains = model_contains(model, data) - if ((context.action if hasattr(context, "action") else context.get_actions()) - != Gdk.DragAction.MOVE) and contains: - continue - drop_info = widget.get_dest_row_at_pos(x, y) - if drop_info: - path, position = drop_info - node = model.get_iter(path) - if (position == Gtk.TreeViewDropPosition.BEFORE - or position == Gtk.TreeViewDropPosition.INTO_OR_BEFORE): - model.insert_before(node, data) - else: - model.insert_after(node, data) + # If the wrapper object is a subclass of ClipDropList then + # the drag data was a list of objects and we need to decode + # all of them. + if isinstance(o,ClipDropList): + o_list = o.get_objects() else: - model.append(data) + o_list = [o] + for o in o_list: + if o.__class__.DRAG_TARGET is None: + continue + data = [o.__class__.DRAG_TARGET.drag_type, o, None, + o._type, o._value, o._dbid, o._dbname] + contains = model_contains(model, data) + if ((context.action if hasattr(context, "action") else context.get_actions()) + != Gdk.DragAction.MOVE) and contains: + continue + drop_info = widget.get_dest_row_at_pos(x, y) + if drop_info: + path, position = drop_info + node = model.get_iter(path) + if (position == Gtk.TreeViewDropPosition.BEFORE + or position == Gtk.TreeViewDropPosition.INTO_OR_BEFORE): + model.insert_before(node, data) + else: + model.insert_after(node, data) + else: + model.append(data) - # FIXME: there is one bug here: if you multi-select and drop - # on self, then it moves the first, and copies the rest. + # FIXME: there is one bug here: if you multi-select and drop + # on self, then it moves the first, and copies the rest. - if ((context.action if hasattr(context, "action") else context.get_actions()) == - Gdk.DragAction.MOVE): - context.finish(True, True, time) + if ((context.action if hasattr(context, "action") else context.get_actions()) == + Gdk.DragAction.MOVE): + context.finish(True, True, time) - # remember time for double drop workaround. - self._previous_drop_time = realTime - return o_list + # remember time for double drop workaround. + self._previous_drop_time = realTime + return o_list + except EOFError: + return None # proxy methods to provide access to the real widget functions. diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index aff6ee3ea..494bae522 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -107,7 +107,8 @@ from .managedwindow import ManagedWindow #------------------------------------------------------------------------- if is_quartz(): try: - gi.require_version('GtkosApplication', '1.0') + import gi + gi.require_version('GtkosxApplication', '1.0') from gi.repository import GtkosxApplication as QuartzApp _GTKOSXAPPLICATION = True except: diff --git a/gramps/plugins/tool/relcalc.py b/gramps/plugins/tool/relcalc.py index 428799c0f..679c89c04 100644 --- a/gramps/plugins/tool/relcalc.py +++ b/gramps/plugins/tool/relcalc.py @@ -118,7 +118,7 @@ class RelCalc(tool.Tool, ManagedWindow): self.textbuffer = Gtk.TextBuffer() self.text.set_buffer(self.textbuffer) - self.model = PersonTreeModel(self.db) + self.model = PersonTreeModel(self.db, uistate) self.tree.set_model(self.model) self.tree.connect('key-press-event', self._key_press) diff --git a/po/ar.po b/po/ar.po index a1d1746a0..d80b5128a 100644 --- a/po/ar.po +++ b/po/ar.po @@ -12,7 +12,7 @@ msgstr "" "PO-Revision-Date: 2014-06-29 15:50+0300\n" "Last-Translator: Munzir Taha (منذر طه) \n" "Language-Team: Arabic <>\n" -"Language: en_US\n" +"Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/es.po b/po/es.po index bdf4f56f4..e8b2a6883 100644 --- a/po/es.po +++ b/po/es.po @@ -15,7 +15,7 @@ msgstr "" "PO-Revision-Date: 2014-04-20 11:10+0100\n" "Last-Translator: Julio Sánchez \n" "Language-Team: \n" -"Language: \n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/he.po b/po/he.po index 4d39fb184..0519c950f 100644 --- a/po/he.po +++ b/po/he.po @@ -12,7 +12,7 @@ msgstr "" "PO-Revision-Date: 2014-03-24 20:15+0300\n" "Last-Translator: Igal Shapira \n" "Language-Team: he \n" -"Language: \n" +"Language: he\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/pt_PT.po b/po/pt_PT.po index 0cbefff73..0759cc719 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -15,7 +15,7 @@ msgstr "" "PO-Revision-Date: 2013-03-03 10:02+0100\n" "Last-Translator: \n" "Language-Team: Portuguese <>\n" -"Language: pt\n" +"Language: pt_PT\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/ro.po b/po/ro.po index dcfedd8c7..06ae3cae1 100644 --- a/po/ro.po +++ b/po/ro.po @@ -12,7 +12,7 @@ msgstr "" "PO-Revision-Date: 2003-03-03 09:54+0100\n" "Last-Translator: Radu Bogdan Mare \n" "Language-Team: romanian \n" -"Language: \n" +"Language: ro\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/sk.po b/po/sk.po index 100d3de04..52da814d9 100644 --- a/po/sk.po +++ b/po/sk.po @@ -13,7 +13,7 @@ msgstr "" "PO-Revision-Date: 2014-05-23 15:34+0100\n" "Last-Translator: Ondrej Krč-Jediný \n" "Language-Team: \n" -"Language: \n" +"Language: sk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/sq.po b/po/sq.po index b8a3be56c..55bdb06f3 100644 --- a/po/sq.po +++ b/po/sq.po @@ -21,7 +21,7 @@ msgstr "" "PO-Revision-Date: 2008-11-13 21:00+0100\n" "Last-Translator: Vlora Jakupi \n" "Language-Team: \n" -"Language: \n" +"Language: sq\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/sr_Latn.po b/po/sr_Latn.po index c2c71e4f8..6cdb9897d 100644 --- a/po/sr_Latn.po +++ b/po/sr_Latn.po @@ -10,7 +10,7 @@ msgstr "" "PO-Revision-Date: 2008-09-08 20:44+0200\n" "Last-Translator: Vlada Perić \n" "Language-Team: Serbian Latin <>\n" -"Language: \n" +"Language: sr_Latn\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/vi.po b/po/vi.po index 30bcea72a..28d64c8b6 100644 --- a/po/vi.po +++ b/po/vi.po @@ -12,7 +12,7 @@ msgstr "" "PO-Revision-Date: 2012-02-29 23:03+0700\n" "Last-Translator: De Tran \n" "Language-Team: VIETNAMESE \n" -"Language: \n" +"Language: vi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n"