From d2363249b94ee590182df29b30b8de930724edb9 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 15 Mar 2015 23:48:12 +0000 Subject: [PATCH] Convert remaining unicode literals --- gramps/gui/dbman.py | 2 +- gramps/plugins/gramplet/givennamegramplet.py | 6 ++++-- gramps/plugins/quickview/samesurnames.py | 6 ++++-- gramps/plugins/rel/rel_ca.py | 8 ++++---- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gramps/gui/dbman.py b/gramps/gui/dbman.py index 58e3cce01..6d584a7ec 100644 --- a/gramps/gui/dbman.py +++ b/gramps/gui/dbman.py @@ -248,7 +248,7 @@ class DbManager(CLIDbManager): if store.get_value(node, STOCK_COL) == Gtk.STOCK_DIALOG_ERROR: path = conv_to_unicode(store.get_value(node, PATH_COL), 'utf8') - backup = os.path.join(path, u"person.gbkp") + backup = os.path.join(path, "person.gbkp") self.repair.set_sensitive(os.path.isfile(backup)) else: self.repair.set_sensitive(False) diff --git a/gramps/plugins/gramplet/givennamegramplet.py b/gramps/plugins/gramplet/givennamegramplet.py index e5eb390cf..d7fe36575 100644 --- a/gramps/plugins/gramplet/givennamegramplet.py +++ b/gramps/plugins/gramplet/givennamegramplet.py @@ -18,6 +18,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # +from __future__ import unicode_literals + from collections import defaultdict from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext @@ -66,9 +68,9 @@ class GivenNameCloudGramplet(Gramplet): allnames = [person.get_primary_name()] + person.get_alternate_names() allnames = set(name.get_first_name().strip() for name in allnames) for givenname in allnames: - anyNBSP = givenname.split(u'\u00A0') + anyNBSP = givenname.split('\u00A0') if len(anyNBSP) > 1: # there was an NBSP, a non-breaking space - first_two = anyNBSP[0] + u'\u00A0' + anyNBSP[1].split()[0] + first_two = anyNBSP[0] + '\u00A0' + anyNBSP[1].split()[0] givensubnames[first_two] += 1 representative_handle[first_two] = person.handle givenname = ' '.join(anyNBSP[1].split()[1:]) diff --git a/gramps/plugins/quickview/samesurnames.py b/gramps/plugins/quickview/samesurnames.py index 4a4c350e8..166a7206f 100644 --- a/gramps/plugins/quickview/samesurnames.py +++ b/gramps/plugins/quickview/samesurnames.py @@ -25,6 +25,8 @@ Display a people who have a person's same surname or given name. """ +from __future__ import unicode_literals + from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext ngettext = glocale.translation.ngettext # else "nearby" comments are ignored @@ -68,9 +70,9 @@ class SameGiven(Rule): src = self.list[0].upper() for name in [person.get_primary_name()] + person.get_alternate_names(): if name.first_name: - anyNBSP = name.first_name.split(u'\u00A0') + anyNBSP = name.first_name.split('\u00A0') if len(anyNBSP) > 1: # there was an NBSP, a non-breaking space - first_two = anyNBSP[0] + u'\u00A0' + anyNBSP[1].split()[0] + first_two = anyNBSP[0] + '\u00A0' + anyNBSP[1].split()[0] if first_two.upper() == src: return True else: diff --git a/gramps/plugins/rel/rel_ca.py b/gramps/plugins/rel/rel_ca.py index 51e9271a7..5baa75f24 100644 --- a/gramps/plugins/rel/rel_ca.py +++ b/gramps/plugins/rel/rel_ca.py @@ -828,9 +828,9 @@ class RelationshipCalculator(gramps.gen.relationship.RelationshipCalculator): """ rel_str = "parents llunyans" - #atgen = u" de la %sena generació" - #bygen = u" per la %sena generació" - #cmt = u" (germans o germanes d'un avantpassat" + atgen % Ga + ")" + #atgen = " de la %sena generació" + #bygen = " per la %sena generació" + #cmt = " (germans o germanes d'un avantpassat" + atgen % Ga + ")" if in_law_a or in_law_b: inlaw = self.INLAW @@ -920,7 +920,7 @@ class RelationshipCalculator(gramps.gen.relationship.RelationshipCalculator): inlaw = "" rel_str = "un parent llunyà%s" % inlaw - #bygen = u" per la %sena generació" + #bygen = " per la %sena generació" if Ga == 0: # b is descendant of a