Convert remaining unicode literals

This commit is contained in:
Nick Hall 2015-03-15 23:48:12 +00:00
parent b70adcb74a
commit d2363249b9
4 changed files with 13 additions and 9 deletions

View File

@ -248,7 +248,7 @@ class DbManager(CLIDbManager):
if store.get_value(node, STOCK_COL) == Gtk.STOCK_DIALOG_ERROR: if store.get_value(node, STOCK_COL) == Gtk.STOCK_DIALOG_ERROR:
path = conv_to_unicode(store.get_value(node, PATH_COL), 'utf8') 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)) self.repair.set_sensitive(os.path.isfile(backup))
else: else:
self.repair.set_sensitive(False) self.repair.set_sensitive(False)

View File

@ -18,6 +18,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# #
# #
from __future__ import unicode_literals
from collections import defaultdict from collections import defaultdict
from gramps.gen.const import GRAMPS_LOCALE as glocale from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
@ -66,9 +68,9 @@ class GivenNameCloudGramplet(Gramplet):
allnames = [person.get_primary_name()] + person.get_alternate_names() allnames = [person.get_primary_name()] + person.get_alternate_names()
allnames = set(name.get_first_name().strip() for name in allnames) allnames = set(name.get_first_name().strip() for name in allnames)
for givenname 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 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 givensubnames[first_two] += 1
representative_handle[first_two] = person.handle representative_handle[first_two] = person.handle
givenname = ' '.join(anyNBSP[1].split()[1:]) givenname = ' '.join(anyNBSP[1].split()[1:])

View File

@ -25,6 +25,8 @@
Display a people who have a person's same surname or given name. 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 from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
ngettext = glocale.translation.ngettext # else "nearby" comments are ignored ngettext = glocale.translation.ngettext # else "nearby" comments are ignored
@ -68,9 +70,9 @@ class SameGiven(Rule):
src = self.list[0].upper() src = self.list[0].upper()
for name in [person.get_primary_name()] + person.get_alternate_names(): for name in [person.get_primary_name()] + person.get_alternate_names():
if name.first_name: 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 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: if first_two.upper() == src:
return True return True
else: else:

View File

@ -828,9 +828,9 @@ class RelationshipCalculator(gramps.gen.relationship.RelationshipCalculator):
""" """
rel_str = "parents llunyans" rel_str = "parents llunyans"
#atgen = u" de la %sena generació" #atgen = " de la %sena generació"
#bygen = u" per la %sena generació" #bygen = " per la %sena generació"
#cmt = u" (germans o germanes d'un avantpassat" + atgen % Ga + ")" #cmt = " (germans o germanes d'un avantpassat" + atgen % Ga + ")"
if in_law_a or in_law_b: if in_law_a or in_law_b:
inlaw = self.INLAW inlaw = self.INLAW
@ -920,7 +920,7 @@ class RelationshipCalculator(gramps.gen.relationship.RelationshipCalculator):
inlaw = "" inlaw = ""
rel_str = "un parent llunyà%s" % inlaw rel_str = "un parent llunyà%s" % inlaw
#bygen = u" per la %sena generació" #bygen = " per la %sena generació"
if Ga == 0: if Ga == 0:
# b is descendant of a # b is descendant of a