2007-08-19 Don Allingham <don@gramps-project.org>

* src/GrampsDbUtils/_WriteGedcom.py (breakup): fix index check



svn: r8840
This commit is contained in:
Don Allingham
2007-08-20 03:15:13 +00:00
parent 95ceb4e904
commit 62044e33a1
2 changed files with 7 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
2007-08-19 Don Allingham <don@gramps-project.org>
* src/GrampsDbUtils/_WriteGedcom.py (breakup): fix index check
2007-08-19 Robert Cawley <rjc@cawley.id.au> 2007-08-19 Robert Cawley <rjc@cawley.id.au>
* src/plugins/DetDescendantReport.py: * src/plugins/DetDescendantReport.py:
* src/plugins/DetAncestralReport.py: * src/plugins/DetAncestralReport.py:

View File

@@ -233,12 +233,13 @@ def breakup(txt, limit):
to avoid issues with spaces. to avoid issues with spaces.
""" """
data = [] data = []
original = txt
while limit < len(txt)+1: while limit < len(txt)+1:
idx = limit-1 idx = limit-1
while txt[idx] in string.whitespace or txt[idx+1] in string.whitespace : while txt[idx-1] in string.whitespace or txt[idx] in string.whitespace :
idx -= 1 idx -= 1
data.append(txt[:idx+1]) data.append(txt[:idx])
txt = txt[idx+1:] txt = txt[idx:]
if len(txt) > 0: if len(txt) > 0:
data.append(txt) data.append(txt)
return data return data