GEDCOM import improvements
svn: r1061
This commit is contained in:
@@ -243,6 +243,10 @@ class Date:
|
|||||||
self.range = -1
|
self.range = -1
|
||||||
self.text = text
|
self.text = text
|
||||||
|
|
||||||
|
def set_text(self,text):
|
||||||
|
self.range = -1
|
||||||
|
self.text = text
|
||||||
|
|
||||||
def set_range(self,val):
|
def set_range(self,val):
|
||||||
self.range = val
|
self.range = val
|
||||||
|
|
||||||
|
@@ -220,13 +220,3 @@ class GedInfoParser:
|
|||||||
elif tag == "residence":
|
elif tag == "residence":
|
||||||
if u2l(attrs['val']) == 'place':
|
if u2l(attrs['val']) == 'place':
|
||||||
self.current.set_resi(RESIDENCE_PLAC)
|
self.current.set_resi(RESIDENCE_PLAC)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
|
|
||||||
g = GedcomInfoDB()
|
|
||||||
|
|
||||||
print g.get_name_list()
|
|
||||||
o = g.get_description("Family Tree Maker")
|
|
||||||
for key in o.gramps2tag_map.keys():
|
|
||||||
print key,o.gramps2tag(key)
|
|
||||||
|
@@ -47,14 +47,3 @@ class QuestionDialog:
|
|||||||
self.task2()
|
self.task2()
|
||||||
self.top.destroy()
|
self.top.destroy()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
def task1(obj):
|
|
||||||
print obj,'1'
|
|
||||||
|
|
||||||
def task2(obj):
|
|
||||||
print obj,'2'
|
|
||||||
|
|
||||||
QuestionDialog('mytitle','This is my message','Abc',task1,'Def',task2)
|
|
||||||
|
|
||||||
gtk.mainloop()
|
|
||||||
|
@@ -199,18 +199,3 @@ def loadRevision(database, file, filename, revision, callback=None):
|
|||||||
|
|
||||||
file.close()
|
file.close()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
import profile
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
|
|
||||||
database = GrampsDB()
|
|
||||||
t1 = time.time()
|
|
||||||
if len(sys.argv) > 2:
|
|
||||||
profile.run('loadData(database, sys.argv[1])')
|
|
||||||
else:
|
|
||||||
loadData(database,sys.argv[1])
|
|
||||||
t2 = time.time()
|
|
||||||
print t2-t1
|
|
||||||
|
@@ -36,7 +36,10 @@ else:
|
|||||||
|
|
||||||
def utf8_to_latin(s):
|
def utf8_to_latin(s):
|
||||||
y = UTF8String(s)
|
y = UTF8String(s)
|
||||||
|
try:
|
||||||
return y.encode("iso-8859-1")
|
return y.encode("iso-8859-1")
|
||||||
|
except:
|
||||||
|
return y.encode("<Invalid UNICODE>")
|
||||||
|
|
||||||
def latin_to_utf8(s):
|
def latin_to_utf8(s):
|
||||||
buff = cStringIO.StringIO()
|
buff = cStringIO.StringIO()
|
||||||
|
@@ -66,11 +66,8 @@ class ChangeTypes:
|
|||||||
original = self.glade.get_widget("original_text").get_text()
|
original = self.glade.get_widget("original_text").get_text()
|
||||||
new = self.glade.get_widget("new_text").get_text()
|
new = self.glade.get_widget("new_text").get_text()
|
||||||
|
|
||||||
print original
|
|
||||||
print new
|
|
||||||
for person in self.db.getPersonMap().values():
|
for person in self.db.getPersonMap().values():
|
||||||
for event in person.getEventList():
|
for event in person.getEventList():
|
||||||
print event.getName()
|
|
||||||
if event.getName() == original:
|
if event.getName() == original:
|
||||||
event.setName(new)
|
event.setName(new)
|
||||||
modified = modified + 1
|
modified = modified + 1
|
||||||
|
@@ -917,6 +917,7 @@ class GedcomParser:
|
|||||||
self.family.addPhoto(photo)
|
self.family.addPhoto(photo)
|
||||||
|
|
||||||
def parse_residence(self,address,level):
|
def parse_residence(self,address,level):
|
||||||
|
note = ""
|
||||||
while 1:
|
while 1:
|
||||||
matches = self.get_next()
|
matches = self.get_next()
|
||||||
|
|
||||||
@@ -1293,6 +1294,7 @@ class GedcomParser:
|
|||||||
|
|
||||||
def parse_name(self,name,level):
|
def parse_name(self,name,level):
|
||||||
"""Parses the person's name information"""
|
"""Parses the person's name information"""
|
||||||
|
note = ""
|
||||||
while 1:
|
while 1:
|
||||||
matches = self.get_next()
|
matches = self.get_next()
|
||||||
if int(matches[0]) < level:
|
if int(matches[0]) < level:
|
||||||
@@ -1538,6 +1540,7 @@ class GedcomParser:
|
|||||||
|
|
||||||
def extract_date(self,text):
|
def extract_date(self,text):
|
||||||
dateobj = Date.Date()
|
dateobj = Date.Date()
|
||||||
|
try:
|
||||||
match = fromtoRegexp.match(text)
|
match = fromtoRegexp.match(text)
|
||||||
if match:
|
if match:
|
||||||
(cal1,data1,cal2,data2) = match.groups()
|
(cal1,data1,cal2,data2) = match.groups()
|
||||||
@@ -1569,7 +1572,8 @@ class GedcomParser:
|
|||||||
dateobj.get_start_date().setMode(abt)
|
dateobj.get_start_date().setMode(abt)
|
||||||
else:
|
else:
|
||||||
dateobj.set(text)
|
dateobj.set(text)
|
||||||
|
except:
|
||||||
|
dateobj.set_text(text)
|
||||||
return dateobj
|
return dateobj
|
||||||
|
|
||||||
def handle_source(self,matches,level):
|
def handle_source(self,matches,level):
|
||||||
|
Reference in New Issue
Block a user