* src/plugins/WriteGedcom.py (export_data): Correct researcher's

PHON field; (write_person): Correct exported PHON fields.
* src/plugins/ReadGedcom.py (parse_residence): Remove PHON field since
it is taken care of by parse_address() now;
(parse_address): Parse PHON field, provided it immediately follows
ADDR structure.


svn: r2489
This commit is contained in:
Alex Roitman 2003-12-10 02:07:05 +00:00
parent 11f4d9c2f4
commit 3e9026bba7
3 changed files with 15 additions and 8 deletions

View File

@ -1,5 +1,11 @@
2003-12-09 Alex Roitman <shura@alex.neuro.umn.edu>
* doc/gramps-manual/ru/getstart.xml: Translation update.
* src/plugins/WriteGedcom.py (export_data): Correct researcher's
PHON field; (write_person): Correct exported PHON fields.
* src/plugins/ReadGedcom.py (parse_residence): Remove PHON field since
it is taken care of by parse_address() now;
(parse_address): Parse PHON field, provided it immediately follows
ADDR structure.
2003-12-08 Don Allingham <dallingham@users.sourceforge.net>
* src/RelLib.py: Add phone to address, postal code and phone to

View File

@ -1054,8 +1054,6 @@ class GedcomParser:
elif matches[1] == "PLAC":
address.setStreet(matches[2])
self.parse_address(address,level+1)
elif matches[1] == "PHON":
pass
elif matches[1] == "NOTE":
note = self.parse_note(matches,address,level+1,note)
else:
@ -1067,7 +1065,10 @@ class GedcomParser:
while 1:
matches = self.get_next()
if int(matches[0]) < level:
self.backup()
if matches[1] == "PHON":
address.setPhone(matches[2])
else:
self.backup()
return
elif matches[1] in [ "ADDR", "ADR1", "ADR2" ]:
val = address.getStreet()
@ -1080,8 +1081,6 @@ class GedcomParser:
address.setStreet(val)
elif matches[1] == "CITY":
address.setCity(matches[2])
elif matches[1] == "PHON":
address.setNote(matches[2])
elif matches[1] == "STAE":
address.setState(matches[2])
elif matches[1] == "POST":

View File

@ -630,11 +630,10 @@ class GedcomWriter:
if owner.getCountry():
self.writeln("2 CONT %s" % self.cnvtxt(owner.getCountry()))
cnt = 1
if owner.getPhone():
self.writeln("2 PHON %s" % self.cnvtxt(owner.getPhone()))
cnt = 1
if cnt == 0:
self.writeln('2 CONT Not Provided')
if owner.getPhone():
self.writeln("1 PHON %s" % self.cnvtxt(owner.getPhone()))
else:
self.writeln('1 ADDR Not Provided')
self.writeln('2 CONT Not Provided')
@ -933,12 +932,15 @@ class GedcomWriter:
self.writeln("3 POST %s" % self.cnvtxt(addr.getPostal()))
if addr.getCountry():
self.writeln("3 CTRY %s" % self.cnvtxt(addr.getCountry()))
if addr.getPhone():
self.writeln("2 PHON %s" % self.cnvtxt(addr.getPhone()))
else:
text = addr.getStreet()
text = addr_append(text,addr.getCity())
text = addr_append(text,addr.getState())
text = addr_append(text,addr.getPostal())
text = addr_append(text,addr.getCountry())
text = addr_append(text,addr.getPhone())
if text:
self.writeln("2 PLAC %s" % string.replace(self.cnvtxt(text),'\r',' '))
if addr.getNote():