* src/plugins/ImportGeneWeb.py: convert witout using latin_utf8.py
* src/plugins/ImportvCard.py: remove unused latin_utf8.py include * src/plugins/TestcaseGenerator.py: remove unused latin_utf8.py include svn: r5251
This commit is contained in:
parent
b8034741df
commit
8e82ce6149
@ -1,3 +1,8 @@
|
|||||||
|
2005-09-29 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||||
|
* src/plugins/ImportGeneWeb.py: convert witout using latin_utf8.py
|
||||||
|
* src/plugins/ImportvCard.py: remove unused latin_utf8.py include
|
||||||
|
* src/plugins/TestcaseGenerator.py: remove unused latin_utf8.py include
|
||||||
|
|
||||||
2005-09-28 Don Allingham <don@gramps-project.org>
|
2005-09-28 Don Allingham <don@gramps-project.org>
|
||||||
* src/NameDisplay.py: Add display_formal
|
* src/NameDisplay.py: Add display_formal
|
||||||
* src/Report.py: remove generation strings
|
* src/Report.py: remove generation strings
|
||||||
|
@ -47,7 +47,6 @@ import gtk.glade
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import Errors
|
import Errors
|
||||||
import RelLib
|
import RelLib
|
||||||
import latin_utf8
|
|
||||||
import Utils
|
import Utils
|
||||||
import const
|
import const
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
@ -100,7 +99,7 @@ class GeneWebParser:
|
|||||||
self.lineno += 1
|
self.lineno += 1
|
||||||
line = self.f.readline()
|
line = self.f.readline()
|
||||||
if line:
|
if line:
|
||||||
line = line.strip()
|
line = unicode( line.strip())
|
||||||
else:
|
else:
|
||||||
line = None
|
line = None
|
||||||
return line
|
return line
|
||||||
@ -282,7 +281,7 @@ class GeneWebParser:
|
|||||||
if not self.current_family:
|
if not self.current_family:
|
||||||
print "Unknown family of child in line %d!" % self.lineno
|
print "Unknown family of child in line %d!" % self.lineno
|
||||||
return None
|
return None
|
||||||
self.current_family.set_note(self.cnv(line))
|
self.current_family.set_note(line)
|
||||||
self.db.commit_family(self.current_family,self.trans)
|
self.db.commit_family(self.current_family,self.trans)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -301,9 +300,9 @@ class GeneWebParser:
|
|||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
if note_txt:
|
if note_txt:
|
||||||
note_txt = note_txt + "\n" + self.cnv(line)
|
note_txt = note_txt + "\n" + line
|
||||||
else:
|
else:
|
||||||
note_txt = note_txt + self.cnv(line)
|
note_txt = note_txt + line
|
||||||
if note_txt:
|
if note_txt:
|
||||||
person.set_note(note_txt)
|
person.set_note(note_txt)
|
||||||
self.db.commit_person(person,self.trans)
|
self.db.commit_person(person,self.trans)
|
||||||
@ -327,6 +326,7 @@ class GeneWebParser:
|
|||||||
#Alex: this failed when fields[idx] was an empty line. Fixed.
|
#Alex: this failed when fields[idx] was an empty line. Fixed.
|
||||||
#while idx < len(fields) and not fields[idx][0] == "+":
|
#while idx < len(fields) and not fields[idx][0] == "+":
|
||||||
while idx < len(fields) and not (fields[idx] and fields[idx][0] == "+"):
|
while idx < len(fields) and not (fields[idx] and fields[idx][0] == "+"):
|
||||||
|
if fields[idx]:
|
||||||
print "Unknown field: '%s' in line %d!" %(fields[idx],self.lineno)
|
print "Unknown field: '%s' in line %d!" %(fields[idx],self.lineno)
|
||||||
idx = idx + 1
|
idx = idx + 1
|
||||||
|
|
||||||
@ -403,11 +403,11 @@ class GeneWebParser:
|
|||||||
if not idx < len(fields):
|
if not idx < len(fields):
|
||||||
print "Missing firstname of person in line %d!" % self.lineno
|
print "Missing firstname of person in line %d!" % self.lineno
|
||||||
return (idx,None)
|
return (idx,None)
|
||||||
firstname = self.decode(self.cnv(fields[idx]))
|
firstname = self.decode(fields[idx])
|
||||||
idx = idx + 1
|
idx = idx + 1
|
||||||
if idx < len(fields) and father_surname:
|
if idx < len(fields) and father_surname:
|
||||||
noSurnameRe = re.compile("^[({\[~><?0-9#].*$")
|
noSurnameRe = re.compile("^[({\[~><?0-9#].*$")
|
||||||
if not noSurnameRe.match(self.cnv(fields[idx])):
|
if not noSurnameRe.match(fields[idx]):
|
||||||
surname = self.decode(fields[idx])
|
surname = self.decode(fields[idx])
|
||||||
idx = idx + 1
|
idx = idx + 1
|
||||||
|
|
||||||
@ -699,7 +699,7 @@ class GeneWebParser:
|
|||||||
return sref
|
return sref
|
||||||
|
|
||||||
def decode(self,s):
|
def decode(self,s):
|
||||||
s = latin_utf8.latin_to_utf8( s.replace('_',' '))
|
s = s.replace('_',' ')
|
||||||
charref_re = re.compile('(&#)(x?)([0-9a-zA-Z]+)(;)')
|
charref_re = re.compile('(&#)(x?)([0-9a-zA-Z]+)(;)')
|
||||||
for match in charref_re.finditer(s):
|
for match in charref_re.finditer(s):
|
||||||
try:
|
try:
|
||||||
@ -723,9 +723,6 @@ class GeneWebParser:
|
|||||||
|
|
||||||
return( s)
|
return( s)
|
||||||
|
|
||||||
def cnv(seld,s):
|
|
||||||
return( latin_utf8.latin_to_utf8(s))
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@ -47,7 +47,6 @@ import gtk.glade
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import Errors
|
import Errors
|
||||||
import RelLib
|
import RelLib
|
||||||
import latin_utf8
|
|
||||||
import Utils
|
import Utils
|
||||||
import const
|
import const
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
|
@ -51,7 +51,6 @@ import gtk.glade
|
|||||||
import Errors
|
import Errors
|
||||||
import Date
|
import Date
|
||||||
import RelLib
|
import RelLib
|
||||||
import latin_utf8
|
|
||||||
import Utils
|
import Utils
|
||||||
import Tool
|
import Tool
|
||||||
import AutoComp
|
import AutoComp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user