~ubuntu-branches/ubuntu/wily/gramps/wily

« back to all changes in this revision

Viewing changes to gramps/plugins/gramplet/givennamegramplet.py

  • Committer: Package Import Robot
  • Author(s): Ross Gammon
  • Date: 2015-05-16 11:49:41 UTC
  • mfrom: (39.1.17 sid)
  • Revision ID: package-import@ubuntu.com-20150516114941-hiku87mi6p7wbjba
Tags: 4.1.3~dfsg-1
* New upstream release
* Fixes manpage desription of import function (LP: #1427444)
* Fixes crash when closing detatched gramplet (Closes: #785393)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
19
#
20
20
#
 
21
from __future__ import unicode_literals
 
22
 
21
23
from collections import defaultdict
22
24
from gramps.gen.const import GRAMPS_LOCALE as glocale
23
25
_ = glocale.translation.gettext
66
68
            allnames = [person.get_primary_name()] + person.get_alternate_names()
67
69
            allnames = set(name.get_first_name().strip() for name in allnames)
68
70
            for givenname in allnames:
69
 
                anyNBSP = givenname.split(u'\u00A0')
 
71
                anyNBSP = givenname.split('\u00A0')
70
72
                if len(anyNBSP) > 1: # there was an NBSP, a non-breaking space
71
 
                    first_two = anyNBSP[0] + u'\u00A0' + anyNBSP[1].split()[0]
 
73
                    first_two = anyNBSP[0] + '\u00A0' + anyNBSP[1].split()[0]
72
74
                    givensubnames[first_two] += 1
73
75
                    representative_handle[first_two] = person.handle
74
76
                    givenname = ' '.join(anyNBSP[1].split()[1:])