2007-05-10 Don Allingham <don@gramps-project.org>

* src/GrampsDb/_ReadXML.py: fix privacy settings
	* src/GrampsDb/_WriteXML.py: fix privacy settings
	* src/LdsUtils.py: updated temple codes
	* src/DbLoader.py: try to handle default directory better

	* src/LdsOrd.py: Update from bug tracker (#925) submitted by robocoder


svn: r8460
This commit is contained in:
Don Allingham 2007-05-11 03:47:58 +00:00
parent 7b413ad8f6
commit cba30529cd
6 changed files with 173 additions and 151 deletions

View File

@ -1,3 +1,9 @@
2007-05-10 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadXML.py: fix privacy settings
* src/GrampsDb/_WriteXML.py: fix privacy settings
* src/LdsUtils.py: updated temple codes
* src/DbLoader.py: try to handle default directory better
2007-05-10 Benny Malengier <bm@cage.ugent.be>
* src/GrampsDb/_ReadXML.py: partly fix #1053, import privacy of person, family,
media, source, place and repo correct. Still to do: sourceref and lds_ordinance
@ -7,6 +13,7 @@
* src/DataViews/_PedigreeView.py: Some rendering fixes for RTL locales
2007-05-09 Don Allingham <don@gramps-project.org>
* src/LdsOrd.py: Update from bug tracker (#925) submitted by robocoder
* src/GrampsDb/_ReadGedcom.py (GedcomParser.func_name_aka): patch submitted
on bug tracker for AKA parameter missing (#1034)

View File

@ -513,12 +513,12 @@ def get_default_dir():
default_dir += os.path.sep
if len(default_dir)<=1:
default_dir = Config.get(Config.RECENT_IMPORT_DIR)
if len(default_dir)<=1:
if not default_dir or len(default_dir)<=1:
default_dir = Config.get(Config.RECENT_EXPORT_DIR)
if len(default_dir)<=1:
default_dir = '~/'
if not default_dir or len(default_dir)<=1:
default_dir = os.path.expanduser('~/')
else:
default_dir = "~/"
default_dir = os.path.expanduser("~/")
return default_dir
#-------------------------------------------------------------------------

View File

@ -677,6 +677,7 @@ class GrampsParser(UpdateCallback):
except KeyError:
gramps_id = self.map_pid(attrs['ref'])
self.placeobj = self.find_place_by_gramps_id(gramps_id)
self.placeobj.private = bool(attrs.get("priv"))
def start_placeobj(self,attrs):
gramps_id = self.map_pid(attrs['id'])
@ -896,6 +897,8 @@ class GrampsParser(UpdateCallback):
self.person = self.find_person_by_gramps_id(new_id)
self.person.private = bool(attrs.get("priv"))
self.person.private = bool(attrs.get("priv"))
# Old and new markers: complete=1 and marker=word both have to work
if attrs.get('complete'): # this is only true for complete=1
self.person.marker.set(RelLib.MarkerType.COMPLETE)
@ -974,7 +977,7 @@ class GrampsParser(UpdateCallback):
url = RelLib.Url()
url.path = attrs["href"]
url.set_description(attrs.get("description",''))
url.privacy = bool(attrs.get('priv'))
url.private = bool(attrs.get('priv'))
url.type.set_from_xml_str(attrs['type'])
if self.person:
self.person.add_url(url)
@ -999,6 +1002,7 @@ class GrampsParser(UpdateCallback):
# Here we need to support old format of <family type="Married">
if attrs.has_key('type'):
self.family.type.set_from_xml_str(attrs["type"])
self.family.private = bool(attrs.get("priv"))
# Old and new markers: complete=1 and marker=word both have to work
if attrs.get('complete'): # this is only true for complete=1
@ -1106,6 +1110,8 @@ class GrampsParser(UpdateCallback):
self.source_ref.ref = handle
self.source_ref.confidence = int(attrs.get("conf",self.conf))
self.source_ref.private = bool(attrs.get("priv"))
if self.photo:
self.photo.add_source_reference(self.source_ref)
elif self.ord:
@ -1142,7 +1148,6 @@ class GrampsParser(UpdateCallback):
self.source.set_gramps_id(gramps_id)
except KeyError:
self.source = self.find_source_by_gramps_id(gramps_id)
self.source.private = bool(attrs.get("priv"))
def start_reporef(self,attrs):
@ -1191,6 +1196,7 @@ class GrampsParser(UpdateCallback):
self.object.set_gramps_id(gramps_id)
except KeyError:
self.object = self.find_object_by_gramps_id(gramps_id)
self.object.private = bool(attrs.get("priv"))
# GRAMPS LEGACY: src, mime, and description attributes
# now belong to the <file> tag. Here we are supporting
@ -1213,7 +1219,6 @@ class GrampsParser(UpdateCallback):
self.repo.set_gramps_id(gramps_id)
except KeyError:
self.repo = self.find_repository_by_gramps_id(gramps_id)
self.repo.private = bool(attrs.get("priv"))
def stop_people(self,*tag):

View File

@ -614,7 +614,9 @@ class XmlWriter(UpdateCallback):
sp = " " * index
sp2 = " " * (index+1)
self.g.write('%s<lds_ord type="%s">\n' % (sp,name))
priv = conf_priv(ord)
self.g.write('%s<lds_ord type="%s"%s>\n' % (sp,name,priv))
dateobj = ord.get_date_object()
if dateobj and not dateobj.is_empty():
self.write_date(dateobj,index+1)
@ -643,13 +645,17 @@ class XmlWriter(UpdateCallback):
d = source_ref.get_date_object()
q = source_ref.get_confidence_level()
self.g.write(" " * index)
priv = conf_priv(source_ref)
if p == "" and c == "" and t == "" and d.is_empty() and q == 2:
self.g.write('<sourceref hlink="%s"/>\n' % ("_"+source.get_handle()))
self.g.write('<sourceref hlink="%s"%s/>\n' % ("_"+source.get_handle(), priv))
else:
if q == 2:
self.g.write('<sourceref hlink="%s">\n' % ("_"+source.get_handle()))
self.g.write('<sourceref hlink="%s"%s>\n' % ("_"+source.get_handle(), priv))
else:
self.g.write('<sourceref hlink="%s" conf="%d">\n' % ("_"+source.get_handle(),q))
self.g.write('<sourceref hlink="%s" conf="%d"%s>\n' % (
"_"+source.get_handle(),q, priv))
self.write_line("spage",p,index+1)
self.write_text("scomments",c,index+1)
self.write_text("stext",t,index+1)

View File

@ -20,12 +20,6 @@
# $Id$
#-------------------------------------------------------------------------
#Updated LDS Temple Codes from:
#http://www.geocities.com/rgpassey/temple/abclist.htm
#Confirmed against Temple Codes list recieved from Raliegh Temple
#Last update: 1/12/02
#-------------------------------------------------------------------------
temples = (
# Temple Name , Code , [Old Codes...]
("Aba, Nigeria" , "ABA", ),
@ -33,7 +27,7 @@ temples = (
("Adelaide, Australia" , "ADELA", ),
("Albuquerque, New Mexico" , "ALBUQ", ),
("Anchorage, Alaska" , "ANCHO", ),
("Apia, Samoa" , "APIA", "AP"),
("Apia, Samoa" , "APIA", "SAMOA", "AP"),
("Asuncion, Paraguay" , "ASUNC", ),
("Atlanta, Georgia" , "ATLAN", "AT"),
("Baton Rouge, Louisiana" , "BROUG", ),
@ -45,46 +39,47 @@ temples = (
("Boise, Idaho" , "BOISE", "BO"),
("Boston, Massachusetts" , "BOSTO", ),
("Bountiful, Utah" , "BOUNT", ),
("Brisban, Australia" , "BRISB", ),
("Brisbane, Australia" , "BRISB", ),
("Buenos Aires, Argentina" , "BAIRE", "BA"),
("Campinas, Brazil" , "CAMPI", ),
("Caracas, Venezuela" , "CARAC", ),
("Cardston, Alberta" , "ALBER", "AL", "ALBR"),
("Cebu, Philippines" , "CEBU", ),
("Chicago, Illinois" , "CHICA", "CH"),
("Ciudad Juarez, Chihuahua" , "CIUJU", ),
("Ciudad Juarez, Mexico" , "CIUJU", ),
("Cochabamba, Boliva" , "COCHA", ),
("Colonia Juarez, Chihuahua" , "COLJU", ),
("Colonia Juarez, Chihuahua, Mexico" , "COLJU", ),
("Columbia, South Carolina" , "COLSC", ),
("Columbia River, Washington" , "CRIVE", ),
("Columbus, Ohio" , "COLUM", ),
("Copenhagen, Denmark" , "COPEN", ),
("Curitiba, Brazil" , "CURIT", ),
("Manhattan, New York" , "MANHA", ),
("Panama City, Panama" , "PCITY", ),
("Dallas, Texas" , "DALLA", "DA"),
("Denver, Colorado" , "DENVE", "DV"),
("Detroit, Michigan" , "DETRO", ),
("Draper, Utah" , "DRAPE", ),
("Edmonton, Alberta" , "EDMON", ),
("Frankfurt, Germany" , "FRANK", "FR"),
("Fresno, California" , "FRESN", ),
("Freiberg, Germany" , "FREIB", "FD"),
("Fresno, California" , "FRESN", ),
("Fukuoka, Japan" , "FUKUO", ),
("Guadalajara, Jalisco" , "GUADA", ),
("Guatamala City, Guatamala" , "GUATE", "GA"),
("Guadalajara, Mexico" , "GUADA", ),
("Guatemala City, Guatemala" , "GUATE", "GA", "GU"),
("Guayaquil, Ecuador" , "GUAYA", "GY"),
("Halifax, Noca Scotia" , "HALIF", ),
("Halifax, Nova Scotia" , "HALIF", ),
("Hamilton, New Zealand" , "NZEAL", "NZ"),
("Harrison, New York" , "NYORK", ),
("Harrison, New York" , "HARRI", "NYORK"),
("Hartford, Connecticut" , "HARTF", ),
("Helsinki, Finland" , "HELSI", ),
("Hermosillo, Sonora" , "HERMO", ),
("Hermosillo, Sonora, Mexico" , "HERMO", ),
("Hong Kong, China" , "HKONG", ),
("Houston, Texas" , "HOUST", ),
("Idaho Falls, Idaho" , "IFALL", ),
("Idaho Falls, Idaho" , "IFALL", "IF"),
("Johannesburg, South Africa" , "JOHAN", "JO"),
("Jordan River, Utah" , "JRIVE", "JR"),
("Kialua Kona, Hawaii" , "KONA", ),
("Kona, Hawaii" , "KONA", ),
("Kiev, Ukraine" , "KIEV", ),
("Kirtland, Ohio" , "KIRTL", ),
("Laie, Hawaii" , "HAWAI", "HA"),
("Las Vegas, Nevada" , "LVEGA", "LV"),
("Lima, Peru" , "LIMA" , "LI"),
@ -94,48 +89,53 @@ temples = (
("Louisville, Kentucky" , "LOUIS", ),
("Lubbock, Texas" , "LUBBO", ),
("Madrid, Spain" , "MADRI", ),
("Manhattan, New York" , "MANHA", ),
("Manila, Philippines" , "MANIL", "MA"),
("Manti, Utah" , "MANTI", "MT"),
("Medford, Oregon" , "MEDFO", ),
("Melbourne, Australia" , "MELBO", ),
("Melphis, Tennessee" , "MEMPH", ),
("Merida, Yucatan" , "MERID", ),
("Memphis, Tennessee" , "MEMPH", ),
("Merida, Mexico" , "MERID", ),
("Mesa, Arizona" , "ARIZO", "AZ"),
("Mexico City, Mexico" , "MEXIC", "MX"),
("Monterrey, Nuevo Leon" , "MONTE", ),
("Monterrey, Mexico" , "MONTE", ),
("Montevideo, Uruguay" , "MNTVD", ),
("Monticello, Utah" , "MONTI", ),
("Montreal, Quebec" , "MONTR", ),
("Mt. Timpanogos, Utah" , "MTIMP", ),
("Nashville, Tennessee" , "NASHV", ),
("Nauvoo, Illinois" , "NAUVO", ),
("Nauvoo, Illinois (New)," , "NAUV2", ),
("Nauvoo, Illinois" , "NAUVO", "NV"),
("Nauvoo, Illinois (New)" , "NAUV2", ),
("Newport Beach, California" , "NBEAC", ),
("Nuku'alofa, Tonga" , "NUKUA", "TG"),
("Oakland, California" , "OAKLA", "OK"),
("Oaxaca, Oaxaca" , "OAKAC", ),
("Oaxaca, Mexico" , "OAXAC", ),
("Ogden, Utah" , "OGDEN", "OG"),
("Oklahoma City, Oklahoma" , "OKLAH", ),
("Oquirrh Mountain, Utah" , "OMOUN", ),
("Orlando, Florida" , "ORLAN", ),
("Palmayra, New York" , "PALMY", ),
("Palmyra, New York" , "PALMY", ),
("Panama City, Panama" , "PANAM", ),
("Papeete, Tahiti" , "PAPEE", "TA"),
("Perth, Australia" , "PERTH", ),
("Portland, Oregon" , "PORTL", "PT"),
("Porto Alegre, Brazil" , "PALEG", ),
("Preston, England" , "PREST", ),
("Provo, Utah" , "PROVO", "PV"),
("Quetzaltenango, Guatemala" , "QUETZ", ),
("Raleigh, North Carolina" , "RALEI", ),
("Recife, Brazil" , "RECIF", ),
("Redlands, California" , "REDLA", ),
("Regina, Saskatchewan" , "REGIN", ),
("Reno, Nevada" , "RENO", ),
("Rexburg, Idaho" , "REXBU", ),
("Sacramento, California" , "SACRA", ),
("St. George, Utah" , "SGEOR", "SG"),
("St. Louis, Missouri" , "SLOUI", ),
("St. Paul, Minnesota" , "SPMIN", ),
("Salt Lake City, Utah" , "SLAKE", "SL"),
("San Diego, California" , "SDIEG", "SA"),
("San Antonio, Texas" , "SANTO", ),
("San Diego, California" , "SDIEG", "SA"),
("San Jose, Costa Rica" , "SJOSE", ),
("Santiago, Chile" , "SANTI", "SN"),
("Santo Domingo, Dominican Republic" , "SDOMI", ),
@ -148,20 +148,25 @@ temples = (
("Suva, Fiji" , "SUVA", ),
("Sydney, Australia" , "SYDNE", "SD"),
("Taipei, Taiwan" , "TAIPE", "TP"),
("Tampico, Tamaulipas" , "TAMPI", ),
("Tampico, Mexico" , "TAMPI", ),
("Tegucigalpa, Honduras" , "TEGUC", ),
("The Hague, Netherlands" , "HAGUE", ),
("Tokyo, Japan" , "TOKYO", "TK"),
("Toronto, Ontario" , "TORNO", "TR"),
("Tuxtla Gutierrez, Chiapas" , "TGUTI", ),
("Vera Cruz, Vera Cruz" , "VERAC", ),
("Toronto, Ontario" , "TORON", "TORNO", "TR"),
("Tuxtla Gutierrez, Mexico" , "TGUTI", ),
("Twin Falls, Idaho" , "TFALL", "TWINF"),
("Vancouver, British Columbia" , "VANCO", ),
("Veracruz, Mexico" , "VERAC", ),
("Vernal, Utah" , "VERNA", ),
("Villahermosa, Tabasco" , "VILLA", ),
("Villahermosa, Mexico" , "VILLA", ),
("Washington, D.C." , "WASHI", "WA"),
("Winter Quarters, Nebraska" , "WINTE", ),
("Winter Quarters, Nebraska" , "WINTE", "WQUAR"),
#Other Places, Not temples.
# Other places. Not temples.
("Endowment House" , "EHOUS", "EH"),
("President's Office" , "POFFI", ),
("President's Office" , "POFFI", "PO"),
("Historian's Office" , "HOFFI", "HO"),
("Other" , "OTHER", ),
)
temple_codes = {}

View File

@ -161,7 +161,6 @@ class LdsOrd(SecondaryObject, SourceBase, NoteBase,
@rtype: list
"""
return [self.temple]
#return [self.temple,self.get_date()]
def get_text_data_child_list(self):
"""