lds specific data moved

svn: r6185
This commit is contained in:
Don Allingham 2006-03-21 06:23:45 +00:00
parent 932025dfda
commit e6f0bf7dda
16 changed files with 325 additions and 310 deletions

View File

@ -2,6 +2,13 @@
* src/GrampsDb/_GrampsIniKeys.py: os independent path * src/GrampsDb/_GrampsIniKeys.py: os independent path
2006-03-20 Don Allingham <don@gramps-project.org> 2006-03-20 Don Allingham <don@gramps-project.org>
* src/lds.py: move LDS specific data out of const.py.in
* src/const.py.in: remove unused info
* src/DataViews.py: allow suppression of tool tips
* src/NameDisplay.py: sorted name key generation
* src/RelLib/_Name.py: remove sorted name function
* src/DisplayTabs.py: assign reference handle to new event_ref
* src/DisplayModels.py: new sort function
* src/Editors/_EditPerson.py: call the callback if defined * src/Editors/_EditPerson.py: call the callback if defined
* src/SelectPerson.py: take out the profiling code * src/SelectPerson.py: take out the profiling code
* src/GrampsDb/_GrampsBSDDB.py: use db.THREAD to avoid * src/GrampsDb/_GrampsBSDDB.py: use db.THREAD to avoid

View File

@ -53,6 +53,8 @@ import Utils
import QuestionDialog import QuestionDialog
import TreeTips import TreeTips
import Errors import Errors
import const
from Editors import EditPerson from Editors import EditPerson
from DdTargets import DdTargets from DdTargets import DdTargets
@ -348,8 +350,9 @@ class PersonView(PageView.PersonNavView):
self.generic_filter_widget.inverted()) self.generic_filter_widget.inverted())
self.tree.set_model(self.model) self.tree.set_model(self.model)
if self.model.tooltip_column != None: if const.use_tips and self.model.tooltip_column != None:
self.tooltips = TreeTips.TreeTips(self.tree, self.model.tooltip_column, self.tooltips = TreeTips.TreeTips(self.tree,
self.model.tooltip_column,
True) True)
self.build_columns() self.build_columns()
self.dirty = False self.dirty = False

View File

@ -436,7 +436,7 @@ class FamilyModel(BaseModel):
def sort_father(self,data): def sort_father(self,data):
if data[2]: if data[2]:
person = self.db.get_person_from_handle(data[2]) person = self.db.get_person_from_handle(data[2])
return person.primary_name.get_sort_name() return NameDisplay.displayer.sort_string(person.primary_name)
else: else:
return u"" return u""
@ -450,7 +450,7 @@ class FamilyModel(BaseModel):
def sort_mother(self,data): def sort_mother(self,data):
if data[3]: if data[3]:
person = self.db.get_person_from_handle(data[3]) person = self.db.get_person_from_handle(data[3])
return person.primary_name.get_sort_name() return NameDisplay.displayer.sort_string(person.primary_name)
else: else:
return u"" return u""

View File

@ -650,6 +650,7 @@ class EventEmbedList(EmbeddedList):
self.rebuild() self.rebuild()
def event_added(self,ref,event): def event_added(self,ref,event):
ref.ref = event.handle
self.get_data().append(ref) self.get_data().append(ref)
self.changed = True self.changed = True
self.rebuild() self.rebuild()
@ -1524,7 +1525,7 @@ class ChildModel(gtk.ListStore):
self.column_birth_place(child), self.column_birth_place(child),
self.column_death_place(child), self.column_death_place(child),
child.get_handle(), child.get_handle(),
child.get_primary_name().get_sort_name(), NameDisplay.display.sort_string(child.primary_name),
self.column_birth_sort(child), self.column_birth_sort(child),
self.column_death_sort(child), self.column_death_sort(child),
]) ])

View File

@ -453,49 +453,49 @@ class EditFamily(EditPrimary):
selector_window.close() selector_window.close()
def mother_clicked(self, obj): # def mother_clicked(self, obj):
handle = self.obj.get_mother_handle()
if handle:
self.obj.set_mother_handle(None)
self.update_mother(None)
else:
from SelectPerson import SelectPerson
data_filter = FastFemaleFilter(self.dbstate.db)
sel = SelectPerson(self.dbstate.db, "Select Mother",
filter=data_filter,
skip=self.obj.get_child_handle_list())
person = sel.run()
if person:
self.obj.set_mother_handle(person.handle)
self.update_mother(person.handle)
# def mother_clicked(self,obj):
# handle = self.obj.get_mother_handle() # handle = self.obj.get_mother_handle()
# if handle: # if handle:
# self.obj.set_mother_handle(None) # self.obj.set_mother_handle(None)
# self.update_mother(None) # self.update_mother(None)
# else: # else:
# filter_spec = PersonFilterSpec() # from SelectPerson import SelectPerson
# filter_spec.set_gender(RelLib.Person.FEMALE)
# child_birth_years = [] # data_filter = FastFemaleFilter(self.dbstate.db)
# for person_handle in self.obj.get_child_handle_list(): # sel = SelectPerson(self.dbstate.db, "Select Mother",
# person = self.db.get_person_from_handle(person_handle) # filter=data_filter,
# event_ref = person.get_birth_ref() # skip=self.obj.get_child_handle_list())
# if event_ref and event_ref.ref: # person = sel.run()
# event = self.db.get_event_from_handle(event_ref.ref)
# child_birth_years.append(event.get_date_object().get_year())
# if len(child_birth_years) > 0: # if person:
# filter_spec.set_birth_year(min(child_birth_years)) # self.obj.set_mother_handle(person.handle)
# filter_spec.set_birth_criteria(PersonFilterSpec.BEFORE) # self.update_mother(person.handle)
def mother_clicked(self,obj):
handle = self.obj.get_mother_handle()
if handle:
self.obj.set_mother_handle(None)
self.update_mother(None)
else:
filter_spec = PersonFilterSpec()
filter_spec.set_gender(RelLib.Person.FEMALE)
child_birth_years = []
for person_handle in self.obj.get_child_handle_list():
person = self.db.get_person_from_handle(person_handle)
event_ref = person.get_birth_ref()
if event_ref and event_ref.ref:
event = self.db.get_event_from_handle(event_ref.ref)
child_birth_years.append(event.get_date_object().get_year())
if len(child_birth_years) > 0:
filter_spec.set_birth_year(min(child_birth_years))
filter_spec.set_birth_criteria(PersonFilterSpec.BEFORE)
# selector = PersonSelector(self.dbstate,self.uistate, selector = PersonSelector(self.dbstate,self.uistate,
# self.track,filter_spec=filter_spec) self.track,filter_spec=filter_spec)
# selector.connect('add-object',self.on_change_mother) selector.connect('add-object',self.on_change_mother)
def on_change_father(self, selector_window, obj): def on_change_father(self, selector_window, obj):
if obj.__class__ == RelLib.Person: if obj.__class__ == RelLib.Person:

View File

@ -31,6 +31,7 @@ import os
import re import re
import string import string
import const import const
import lds
import time import time
from TransUtils import sgettext as _ from TransUtils import sgettext as _
@ -1430,8 +1431,8 @@ class GedcomParser:
elif matches[1] == TOKEN_NOTE: elif matches[1] == TOKEN_NOTE:
note = self.parse_note(matches,lds_ord,level+1,note) note = self.parse_note(matches,lds_ord,level+1,note)
elif matches[1] == TOKEN_STAT: elif matches[1] == TOKEN_STAT:
if const.lds_status.has_key(matches[2]): if lds.status.has_key(matches[2]):
lds_ord.set_status(const.lds_status[matches[2]]) lds_ord.set_status(lds.status[matches[2]])
else: else:
self.barf(level+1) self.barf(level+1)
@ -2401,11 +2402,11 @@ def load_place_values(place,text):
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def extract_temple(matches): def extract_temple(matches):
try: try:
if const.lds_temple_to_abrev.has_key(matches[2]): if lds.temple_to_abrev.has_key(matches[2]):
return const.lds_temple_to_abrev[matches[2]] return lds.temple_to_abrev[matches[2]]
else: else:
values = matches[2].split() values = matches[2].split()
return const.lds_temple_to_abrev[values[0]] return lds.temple_to_abrev[values[0]]
except: except:
return None return None

View File

@ -1368,7 +1368,6 @@ class GrampsParser:
if self.name.get_type() == "": if self.name.get_type() == "":
self.name.set_type("Birth Name") self.name.set_type("Birth Name")
self.person.set_primary_name (self.name) self.person.set_primary_name (self.name)
self.person.get_primary_name().build_sort_name()
self.name = None self.name = None
def stop_rname(self,tag): def stop_rname(self,tag):

View File

@ -30,6 +30,12 @@ import os
import time import time
import re import re
import shutil import shutil
try:
set()
except:
from sets import Set as set
from TransUtils import sgettext as _ from TransUtils import sgettext as _
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -56,6 +62,7 @@ import gtk.glade
import RelLib import RelLib
import GenericFilter import GenericFilter
import const import const
import lds
import _GedcomInfo as GedcomInfo import _GedcomInfo as GedcomInfo
import Errors import Errors
import ansel_utf8 import ansel_utf8
@ -69,6 +76,16 @@ def keep_utf8(s):
def iso8859(s): def iso8859(s):
return s.encode('iso-8859-1','replace') return s.encode('iso-8859-1','replace')
#-------------------------------------------------------------------------
#
# GEDCOM tags representing attributes that may take a parameter, value or
# description on the same line as the tag
#
#-------------------------------------------------------------------------
personalAttributeTakesParam = set(["CAST", "DSCR", "EDUC", "IDNO",
"NATI", "NCHI", "NMR", "OCCU",
"PROP", "RELI", "SSN", "TITL"])
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Calendar month names # Calendar month names
@ -711,7 +728,7 @@ class GedcomWriter:
mother_alive = Utils.probably_alive(person,self.db) mother_alive = Utils.probably_alive(person,self.db)
if not self.restrict or ( not father_alive and not mother_alive ): if not self.restrict or ( not father_alive and not mother_alive ):
self.write_ord("SLGS",family.get_lds_sealing(),1,const.lds_ssealing) self.write_ord("SLGS",family.get_lds_sealing(),1,lds.ssealing)
for event_ref in family.get_event_ref_list(): for event_ref in family.get_event_ref_list():
event_handle = event_ref.ref event_handle = event_ref.ref
@ -869,9 +886,9 @@ class GedcomWriter:
ad = 0 ad = 0
self.write_ord("BAPL",person.get_lds_baptism(),1,const.lds_baptism) self.write_ord("BAPL",person.get_lds_baptism(),1,lds.baptism)
self.write_ord("ENDL",person.get_lds_endowment(),1,const.lds_baptism) self.write_ord("ENDL",person.get_lds_endowment(),1,lds.baptism)
self.write_ord("SLGC",person.get_lds_sealing(),1,const.lds_csealing) self.write_ord("SLGC",person.get_lds_sealing(),1,lds.csealing)
for event_ref in person.get_event_ref_list(): for event_ref in person.get_event_ref_list():
event = self.db.get_event_from_handle(event_ref.ref) event = self.db.get_event_from_handle(event_ref.ref)
@ -904,7 +921,7 @@ class GedcomWriter:
else: else:
self.writeln('3 ADOP HUSB') self.writeln('3 ADOP HUSB')
elif val : elif val :
if const.personalGedcomAttributeTakesParam.has_key(val): if val in personalAttributeTakesParam:
if event.get_description(): if event.get_description():
self.writeln("1 %s %s" % (self.cnvtxt(val),\ self.writeln("1 %s %s" % (self.cnvtxt(val),\
self.cnvtxt(event.get_description()))) self.cnvtxt(event.get_description())))

View File

@ -66,6 +66,7 @@ gdir_PYTHON = \
gramps.py\ gramps.py\
GrampsWidgets.py\ GrampsWidgets.py\
ImgManip.py\ ImgManip.py\
lds.py \
ListModel.py\ ListModel.py\
MergeData.py\ MergeData.py\
MergePeople.py\ MergePeople.py\

View File

@ -69,6 +69,9 @@ class NameDisplay:
""" """
self.force_upper = upper self.force_upper = upper
def sort_string(self,name):
return u"%-25s%-30s%s" % (name.surname,name.first_name,name.suffix)
def sorted(self,person): def sorted(self,person):
""" """
Returns a text string representing the L{RelLib.Person} instance's Returns a text string representing the L{RelLib.Person} instance's

View File

@ -305,7 +305,7 @@ class PeopleModel(gtk.GenericTreeModel):
def column_sort_name(self,data,node): def column_sort_name(self,data,node):
n = Name() n = Name()
n.unserialize(data[_NAME_COL]) n.unserialize(data[_NAME_COL])
return n.get_sort_name() return NameDisplay.displayer.sort_string(n)
def column_spouse(self,data,node): def column_spouse(self,data,node):
spouses_names = u"" spouses_names = u""

View File

@ -124,8 +124,6 @@ class Name(PrivateSourceNote,DateBase):
""" """
return [self.first_name,self.surname,self.suffix,self.title, return [self.first_name,self.surname,self.suffix,self.title,
self.type[1],self.prefix,self.patronymic] self.type[1],self.prefix,self.patronymic]
#return [self.first_name,self.surname,self.suffix,self.title,
# self.type[1],self.prefix,self.patronymic,self.get_date()]
def get_text_data_child_list(self): def get_text_data_child_list(self):
""" """
@ -237,34 +235,21 @@ class Name(PrivateSourceNote,DateBase):
"""returns the type of the Name instance""" """returns the type of the Name instance"""
return self.type return self.type
def build_sort_name(self):
if self.surname:
self.sname = "%-25s%-30s%s" % (self.surname,self.first_name,self.suffix)
else:
self.sname = "@"
def set_first_name(self,name): def set_first_name(self,name):
"""sets the given name for the Name instance""" """sets the given name for the Name instance"""
self.first_name = name self.first_name = name
self.build_sort_name()
def set_patronymic(self,name): def set_patronymic(self,name):
"""sets the patronymic name for the Name instance""" """sets the patronymic name for the Name instance"""
self.patronymic = name self.patronymic = name
self.build_sort_name()
def set_surname(self,name): def set_surname(self,name):
"""sets the surname (or last name) for the Name instance""" """sets the surname (or last name) for the Name instance"""
self.surname = name self.surname = name
self.build_sort_name()
def set_suffix(self,name): def set_suffix(self,name):
"""sets the suffix (such as Jr., III, etc.) for the Name instance""" """sets the suffix (such as Jr., III, etc.) for the Name instance"""
self.suffix = name self.suffix = name
self.build_sort_name()
def get_sort_name(self):
return self.sname
def get_first_name(self): def get_first_name(self):
"""returns the given name for the Name instance""" """returns the given name for the Name instance"""

View File

@ -406,9 +406,9 @@ class ViewManager:
about = gtk.AboutDialog() about = gtk.AboutDialog()
about.set_name(const.program_name) about.set_name(const.program_name)
about.set_version(const.version) about.set_version(const.version)
about.set_copyright(const.copyright) about.set_copyright(const.copyright_msg)
try: try:
f = open(const.license,"r") f = open(const.license_file,"r")
about.set_license(f.read().replace('\x0c','')) about.set_license(f.read().replace('\x0c',''))
f.close() f.close()
except: except:

View File

@ -51,17 +51,6 @@ app_gramps_package = "application/x-gramps-package"
app_geneweb = "application/x-geneweb" app_geneweb = "application/x-geneweb"
app_vcard = ["text/x-vcard","text/x-vcalendar"] app_vcard = ["text/x-vcard","text/x-vcalendar"]
#-------------------------------------------------------------------------
#
# Display update values
#
#-------------------------------------------------------------------------
UPDATE_PERSON = 0x1
UPDATE_FAMILY = 0x2
UPDATE_PLACE = 0x4
UPDATE_SOURCE = 0x8
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Paths to external programs # Paths to external programs
@ -82,25 +71,36 @@ prefixdir = "@GPREFIX@"
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
no_gconf = False no_gconf = False
#-------------------------------------------------------------------------
#
# Determine the home directory. According to Wikipedia, most UNIX like
# systems use HOME. I'm assuming that this would apply to OS X as well.
# Windows apparently uses USERPROFILE
#
#-------------------------------------------------------------------------
if os.environ.has_key('HOME'):
home_dir = os.path(os.environ['HOME'],'.gramps')
else:
home_dir = os.path(os.environ['USERPROFILE'],'gramps')
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Paths to files - assumes that files reside in the same directory as # Paths to files - assumes that files reside in the same directory as
# this one, and that the plugins directory is in a directory below this. # this one, and that the plugins directory is in a directory below this.
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
root_dir = os.path.abspath(os.path.dirname(__file__)) root_dir = os.path.abspath(os.path.dirname(__file__))
image_dir = os.path.join(root_dir,"images") image_dir = os.path.join(root_dir,"images")
custom_filters = "~/.gramps/custom_filters.xml" custom_filters = os.path.join(home_dir,"custom_filters.xml")
report_options = "~/.gramps/report_options.xml" report_options = os.path.join(home_dir,"report_options.xml")
tool_options = "~/.gramps/tool_options.xml" tool_options = os.path.join(home_dir,"tool_options.xml")
bsddbenv_dir = "~/.gramps/bsddbenv" bsddbenv_dir = os.path.join(home_dir,"bsddbenv")
icon = os.path.join(root_dir,"images","gramps.png") icon = os.path.join(root_dir,"images","gramps.png")
logo = os.path.join(root_dir,"images","logo.png") logo = os.path.join(root_dir,"images","logo.png")
splash = os.path.join(root_dir,"images","splash.jpg") splash = os.path.join(root_dir,"images","splash.jpg")
license = os.path.join(root_dir,"COPYING") license_file = os.path.join(root_dir,"COPYING")
# #
# Glade files # Glade files
@ -119,10 +119,11 @@ docgenDir = os.path.join(root_dir,"docgen")
data_dir = os.path.join(root_dir,"data") data_dir = os.path.join(root_dir,"data")
system_filters = os.path.join(data_dir,"system_filters.xml") system_filters = os.path.join(data_dir,"system_filters.xml")
template_dir = os.path.join(data_dir,"templates") template_dir = os.path.join(data_dir,"templates")
papersize = "file:%s/papersize.xml" % data_dir
tipdata = os.path.join(data_dir,"tips.xml") tipdata = os.path.join(data_dir,"tips.xml")
fdl = os.path.join(data_dir,"fdl.txt") fdl = os.path.join(data_dir,"fdl.txt")
papersize = "file:%s/papersize.xml" % data_dir
startup = 1 startup = 1
dnd_images = 1 dnd_images = 1
use_tips = False use_tips = False
@ -134,7 +135,7 @@ use_tips = False
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
program_name = "GRAMPS" program_name = "GRAMPS"
version = "@VERSIONSTRING@" version = "@VERSIONSTRING@"
copyright = unicode("© 2001-2005 Donald N. Allingham","iso-8859-1") copyright_msg = unicode("© 2001-2006 Donald N. Allingham","iso-8859-1")
comments = _("GRAMPS (Genealogical Research and Analysis " comments = _("GRAMPS (Genealogical Research and Analysis "
"Management Programming System) is a personal " "Management Programming System) is a personal "
"genealogy program.") "genealogy program.")
@ -217,213 +218,3 @@ longopts = [
shortopts = "O:i:o:f:a:p:?" shortopts = "O:i:o:f:a:p:?"
#-------------------------------------------------------------------------
#
# GEDCOM tags representing attributes that may take a parameter, value or
# description on the same line as the tag
#
#-------------------------------------------------------------------------
personalGedcomAttributeTakesParam = {
"CAST" : 1,
"DSCR" : 1,
"EDUC" : 1,
"IDNO" : 1,
"NATI" : 1,
"NCHI" : 1,
"NMR" : 1,
"OCCU" : 1,
"PROP" : 1,
"RELI" : 1,
"SSN" : 1,
"TITL" : 1
}
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
places = []
surnames = []
#
#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
#
lds_temple_codes = {
"Aba, Nigeria" : "ABA", #1 Added
"Accra, Ghana" : "ACCRA", #2 Added
"Adelaide, Australia" : "ADELA", #3 Added
"Albuquerque, New Mexico" : "ALBUQ", #4 Added
"Anchorage, Alaska" : "ANCHO", #6 Added
"Apia, Samoa" : "APIA", #7
"Asuncion, Paraguay" : "ASUNC", #8 Added
"Atlanta, Georgia" : "ATLAN", #9
"Baton Rouge, Louisiana" : "BROUG", #10 Added
"Bern, Switzerland" : "SWISS", #11
"Billings, Montana" : "BILLI", #12 Added
"Birmingham, Alabama" : "BIRMI", #13 Added
"Bismarck, North Dakota" : "BISMA", #14 Added
"Bogota, Columbia" : "BOGOT", #15
"Boise, Idaho" : "BOISE", #16
"Boston, Massachusetts" : "BOSTO", #17 Added
"Bountiful, Utah" : "BOUNT", #18
"Brisban, Australia" : "BRISB", #19 Added
"Buenos Aires, Argentina" : "BAIRE", #20
"Campinas, Brazil" : "CAMPI", #21 Added
"Caracas, Venezuela" : "CARAC", #22 Added
"Cardston, Alberta" : "ALBER", #23
"Chicago, Illinois" : "CHICA", #24
"Ciudad Juarez, Chihuahua" : "CIUJU", #25 Added
"Cochabamba, Boliva" : "COCHA", #26
"Colonia Juarez, Chihuahua" : "COLJU", #27 Added
"Columbia, South Carolina" : "COLSC", #28 Added
"Columbia River, Washington" : "CRIVE", #121 Added
"Columbus, Ohio" : "COLUM", #29 Added
"Copenhagen, Denmark" : "COPEN", #30 Added
"Curitiba, Brazil" : "CURIT",
"Manhattan, New York" : "MANHA",
"Panama City, Panama" : "PCITY",
"Dallas, Texas" : "DALLA", #31
"Denver, Colorado" : "DENVE", #32
"Detroit, Michigan" : "DETRO", #33 Added
"Edmonton, Alberta" : "EDMON", #34 Added
"Frankfurt, Germany" : "FRANK", #35
"Fresno, California" : "FRESN", #36 Added
"Freiberg, Germany" : "FREIB", #37
"Fukuoka, Japan" : "FUKUO", #38 Added
"Guadalajara, Jalisco" : "GUADA", #39 Added
"Guatamala City, Guatamala" : "GUATE", #40
"Guayaquil, Ecuador" : "GUAYA", #41
"Halifax, Noca Scotia" : "HALIF", #42 Added
"Hamilton, New Zealand" : "NZEAL", #43
"Harrison, New York" : "NYORK", #44 Added
"Hartford, Connecticut" : "HARTF", #Can not find in list used. ?
"Helsinki, Finland" : "HELSI", #45 Added
"Hermosillo, Sonora" : "HERMO", #46 Added
"Hong Kong, China" : "HKONG", #47
"Houston, Texas" : "HOUST", #48 Added
"Idaho Falls, Idaho" : "IFALL", #49
"Johannesburg, South Africa" : "JOHAN", #50
"Jordan River, Utah" : "JRIVE", #111
"Kialua Kona, Hawaii" : "KONA", #51 Added
"Kiev, Ukraine" : "KIEV", #52 Added
"Laie, Hawaii" : "HAWAI", #54
"Las Vegas, Nevada" : "LVEGA", #55
"Lima, Peru" : "LIMA" , #56
"Logan, Utah" : "LOGAN", #57
"London, England" : "LONDO", #58
"Los Angeles, California" : "LANGE", #59
"Louisville, Kentucky" : "LOUIS", #60 Added
"Lubbock, Texas" : "LUBBO", #61 Added
"Madrid, Spain" : "MADRI", #62
"Manila, Philippines" : "MANIL", #63
"Manti, Utah" : "MANTI", #64
"Medford, Oregon" : "MEDFO", #65 Added
"Melbourne, Australia" : "MELBO", #66 Added
"Melphis, Tennessee" : "MEMPH", #67 Added
"Merida, Yucatan" : "MERID", #68 Added
"Mesa, Arizona" : "ARIZO", #69
"Mexico City, Mexico" : "MEXIC", #70
"Monterrey, Nuevo Leon" : "MONTE", #71 Added
"Montevideo, Uruguay" : "MNTVD", #72
"Monticello, Utah" : "MONTI", #73 Added
"Montreal, Quebec" : "MONTR", #74 Added
"Mt. Timpanogos, Utah" : "MTIMP", #5
"Nashville, Tennessee" : "NASHV", #75
"Nauvoo, Illinois" : "NAUVO", #76
"Nauvoo, Illinois (New)" : "NAUV2", #Rebuilt Added
"Newport Beach, California" : "NBEAC", #77 Added
"Nuku'alofa, Tonga" : "NUKUA", #78
"Oakland, California" : "OAKLA", #79
"Oaxaca, Oaxaca" : "OAKAC", #80 Added
"Ogden, Utah" : "OGDEN", #81
"Oklahoma City, Oklahoma" : "OKLAH", #82 Added
"Orlando, Florida" : "ORLAN", #84
"Palmayra, New York" : "PALMY", #85 Added
"Papeete, Tahiti" : "PAPEE", #86
"Perth, Australia" : "PERTH", #87 Added
"Portland, Oregon" : "PORTL", #88
"Porto Alegre, Brazil" : "PALEG", #89 Added
"Preston, England" : "PREST", #90
"Provo, Utah" : "PROVO", #91
"Raleigh, North Carolina" : "RALEI", #92 Added
"Recife, Brazil" : "RECIF", #93
"Redlands, California" : "REDLA", #94 Added
"Regina, Saskatchewan" : "REGIN", #95 Added
"Reno, Nevada" : "RENO", #96 Added
"Sacramento, California" : "SACRA", #97 Added
"St. George, Utah" : "SGEOR", #98
"St. Louis, Missouri" : "SLOUI", #99
"St. Paul, Minnesota" : "SPMIN", #100 Added
"Salt Lake City, Utah" : "SLAKE", #101
"San Diego, California" : "SDIEG", #102
"San Antonio, Texas" : "ANTON", #103 Added
"San Jose, Costa Rica" : "SJOSE", #104 Added
"Santiago, Chile" : "SANTI", #105
"Santo Domingo, Dominican Republic" : "SDOMI", #106
"Sao Paulo, Brazil" : "SPAUL", #107
"Seattle, Washington" : "SEATT", #108
"Seoul, South Korea" : "SEOUL", #109
"Snowflake, Arizona" : "SNOWF", #110 Added
"Spokane, Washington" : "SPOKA", #112
"Stockholm, Sweden" : "STOCK", #113
"Suva, Fiji" : "SUVA", #114 Added
"Sydney, Australia" : "SYDNE", #115
"Taipei, Taiwan" : "TAIPE", #116
"Tampico, Tamaulipas" : "TAMPI", #117 Added
"The Hague, Netherlands" : "HAGUE", #118 Added
"Tokyo, Japan" : "TOKYO", #119
"Toronto, Ontario" : "TORNO", #120
"Tuxtla Gutierrez, Chiapas" : "TGUTI", #122 Added
"Vera Cruz, Vera Cruz" : "VERAC", #123 Added
"Vernal, Utah" : "VERNA", #124
"Villahermosa, Tabasco" : "VILLA", #125 Added
"Washington, D.C." : "WASHI", #126
"Winter Quarters, Nebraska" : "WINTE", #83 Added
#Other Places
"Endowment House" : "EHOUS", #Not a temple per se
"President's Office" : "POFFI", #Not a temple per se
}
lds_temple_to_abrev = {}
for (name,abbr) in lds_temple_codes.iteritems():
lds_temple_to_abrev[abbr] = name
lds_status = {
"BIC" : 1, "CANCELED" : 1, "CHILD" : 1,
"CLEARED" : 2, "COMPLETED" : 3, "DNS" : 4,
"INFANT" : 4, "PRE-1970" : 5, "QUALIFIED" : 6,
"DNS/CAN" : 7, "STILLBORN" : 7, "SUBMITTED" : 8,
"UNCLEARED" : 9,
}
lds_baptism = [
_("<No Status>"), _("Child"), _("Cleared"), _("Completed"),
_("Infant"), _("Pre-1970"), _("Qualified"), _("Stillborn"),
_("Submitted"), _("Uncleared"),
]
lds_csealing = [
_("<No Status>"), _("BIC"), _("Cleared"), _("Completed"),
_("DNS"), _("Pre-1970"), _("Qualified"), _("Stillborn"),
_("Submitted"), _("Uncleared"),
]
lds_ssealing = [
_("<No Status>"), _("Canceled"), _("Cleared"), _("Completed"),
_("DNS"), _("Pre-1970"), _("Qualified"), _("DNS/CAN"),
_("Submitted"), _("Uncleared"),
]
notes_formats = [
_("Flowed"),
_("Preformatted"),
]

206
src/lds.py Normal file
View File

@ -0,0 +1,206 @@
# -*- python -*-
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id: const.py.in 6156 2006-03-16 20:25:15Z rshura $
#-------------------------------------------------------------------------
#
# Standard python modules
#
#-------------------------------------------------------------------------
from TransUtils import sgettext as _
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
#
#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
#
lds_temple_codes = {
"Aba, Nigeria" : "ABA", #1 Added
"Accra, Ghana" : "ACCRA", #2 Added
"Adelaide, Australia" : "ADELA", #3 Added
"Albuquerque, New Mexico" : "ALBUQ", #4 Added
"Anchorage, Alaska" : "ANCHO", #6 Added
"Apia, Samoa" : "APIA", #7
"Asuncion, Paraguay" : "ASUNC", #8 Added
"Atlanta, Georgia" : "ATLAN", #9
"Baton Rouge, Louisiana" : "BROUG", #10 Added
"Bern, Switzerland" : "SWISS", #11
"Billings, Montana" : "BILLI", #12 Added
"Birmingham, Alabama" : "BIRMI", #13 Added
"Bismarck, North Dakota" : "BISMA", #14 Added
"Bogota, Columbia" : "BOGOT", #15
"Boise, Idaho" : "BOISE", #16
"Boston, Massachusetts" : "BOSTO", #17 Added
"Bountiful, Utah" : "BOUNT", #18
"Brisban, Australia" : "BRISB", #19 Added
"Buenos Aires, Argentina" : "BAIRE", #20
"Campinas, Brazil" : "CAMPI", #21 Added
"Caracas, Venezuela" : "CARAC", #22 Added
"Cardston, Alberta" : "ALBER", #23
"Chicago, Illinois" : "CHICA", #24
"Ciudad Juarez, Chihuahua" : "CIUJU", #25 Added
"Cochabamba, Boliva" : "COCHA", #26
"Colonia Juarez, Chihuahua" : "COLJU", #27 Added
"Columbia, South Carolina" : "COLSC", #28 Added
"Columbia River, Washington" : "CRIVE", #121 Added
"Columbus, Ohio" : "COLUM", #29 Added
"Copenhagen, Denmark" : "COPEN", #30 Added
"Curitiba, Brazil" : "CURIT",
"Manhattan, New York" : "MANHA",
"Panama City, Panama" : "PCITY",
"Dallas, Texas" : "DALLA", #31
"Denver, Colorado" : "DENVE", #32
"Detroit, Michigan" : "DETRO", #33 Added
"Edmonton, Alberta" : "EDMON", #34 Added
"Frankfurt, Germany" : "FRANK", #35
"Fresno, California" : "FRESN", #36 Added
"Freiberg, Germany" : "FREIB", #37
"Fukuoka, Japan" : "FUKUO", #38 Added
"Guadalajara, Jalisco" : "GUADA", #39 Added
"Guatamala City, Guatamala" : "GUATE", #40
"Guayaquil, Ecuador" : "GUAYA", #41
"Halifax, Noca Scotia" : "HALIF", #42 Added
"Hamilton, New Zealand" : "NZEAL", #43
"Harrison, New York" : "NYORK", #44 Added
"Hartford, Connecticut" : "HARTF", #Can not find in list used. ?
"Helsinki, Finland" : "HELSI", #45 Added
"Hermosillo, Sonora" : "HERMO", #46 Added
"Hong Kong, China" : "HKONG", #47
"Houston, Texas" : "HOUST", #48 Added
"Idaho Falls, Idaho" : "IFALL", #49
"Johannesburg, South Africa" : "JOHAN", #50
"Jordan River, Utah" : "JRIVE", #111
"Kialua Kona, Hawaii" : "KONA", #51 Added
"Kiev, Ukraine" : "KIEV", #52 Added
"Laie, Hawaii" : "HAWAI", #54
"Las Vegas, Nevada" : "LVEGA", #55
"Lima, Peru" : "LIMA" , #56
"Logan, Utah" : "LOGAN", #57
"London, England" : "LONDO", #58
"Los Angeles, California" : "LANGE", #59
"Louisville, Kentucky" : "LOUIS", #60 Added
"Lubbock, Texas" : "LUBBO", #61 Added
"Madrid, Spain" : "MADRI", #62
"Manila, Philippines" : "MANIL", #63
"Manti, Utah" : "MANTI", #64
"Medford, Oregon" : "MEDFO", #65 Added
"Melbourne, Australia" : "MELBO", #66 Added
"Melphis, Tennessee" : "MEMPH", #67 Added
"Merida, Yucatan" : "MERID", #68 Added
"Mesa, Arizona" : "ARIZO", #69
"Mexico City, Mexico" : "MEXIC", #70
"Monterrey, Nuevo Leon" : "MONTE", #71 Added
"Montevideo, Uruguay" : "MNTVD", #72
"Monticello, Utah" : "MONTI", #73 Added
"Montreal, Quebec" : "MONTR", #74 Added
"Mt. Timpanogos, Utah" : "MTIMP", #5
"Nashville, Tennessee" : "NASHV", #75
"Nauvoo, Illinois" : "NAUVO", #76
"Nauvoo, Illinois (New)" : "NAUV2", #Rebuilt Added
"Newport Beach, California" : "NBEAC", #77 Added
"Nuku'alofa, Tonga" : "NUKUA", #78
"Oakland, California" : "OAKLA", #79
"Oaxaca, Oaxaca" : "OAKAC", #80 Added
"Ogden, Utah" : "OGDEN", #81
"Oklahoma City, Oklahoma" : "OKLAH", #82 Added
"Orlando, Florida" : "ORLAN", #84
"Palmayra, New York" : "PALMY", #85 Added
"Papeete, Tahiti" : "PAPEE", #86
"Perth, Australia" : "PERTH", #87 Added
"Portland, Oregon" : "PORTL", #88
"Porto Alegre, Brazil" : "PALEG", #89 Added
"Preston, England" : "PREST", #90
"Provo, Utah" : "PROVO", #91
"Raleigh, North Carolina" : "RALEI", #92 Added
"Recife, Brazil" : "RECIF", #93
"Redlands, California" : "REDLA", #94 Added
"Regina, Saskatchewan" : "REGIN", #95 Added
"Reno, Nevada" : "RENO", #96 Added
"Sacramento, California" : "SACRA", #97 Added
"St. George, Utah" : "SGEOR", #98
"St. Louis, Missouri" : "SLOUI", #99
"St. Paul, Minnesota" : "SPMIN", #100 Added
"Salt Lake City, Utah" : "SLAKE", #101
"San Diego, California" : "SDIEG", #102
"San Antonio, Texas" : "ANTON", #103 Added
"San Jose, Costa Rica" : "SJOSE", #104 Added
"Santiago, Chile" : "SANTI", #105
"Santo Domingo, Dominican Republic" : "SDOMI", #106
"Sao Paulo, Brazil" : "SPAUL", #107
"Seattle, Washington" : "SEATT", #108
"Seoul, South Korea" : "SEOUL", #109
"Snowflake, Arizona" : "SNOWF", #110 Added
"Spokane, Washington" : "SPOKA", #112
"Stockholm, Sweden" : "STOCK", #113
"Suva, Fiji" : "SUVA", #114 Added
"Sydney, Australia" : "SYDNE", #115
"Taipei, Taiwan" : "TAIPE", #116
"Tampico, Tamaulipas" : "TAMPI", #117 Added
"The Hague, Netherlands" : "HAGUE", #118 Added
"Tokyo, Japan" : "TOKYO", #119
"Toronto, Ontario" : "TORNO", #120
"Tuxtla Gutierrez, Chiapas" : "TGUTI", #122 Added
"Vera Cruz, Vera Cruz" : "VERAC", #123 Added
"Vernal, Utah" : "VERNA", #124
"Villahermosa, Tabasco" : "VILLA", #125 Added
"Washington, D.C." : "WASHI", #126
"Winter Quarters, Nebraska" : "WINTE", #83 Added
#Other Places
"Endowment House" : "EHOUS", #Not a temple per se
"President's Office" : "POFFI", #Not a temple per se
}
lds_temple_to_abrev = {}
for (name,abbr) in lds_temple_codes.iteritems():
lds_temple_to_abrev[abbr] = name
status = {
"BIC" : 1, "CANCELED" : 1, "CHILD" : 1,
"CLEARED" : 2, "COMPLETED" : 3, "DNS" : 4,
"INFANT" : 4, "PRE-1970" : 5, "QUALIFIED" : 6,
"DNS/CAN" : 7, "STILLBORN" : 7, "SUBMITTED" : 8,
"UNCLEARED" : 9,
}
csealing = [
_("<No Status>"), _("BIC"), _("Cleared"), _("Completed"),
_("DNS"), _("Pre-1970"), _("Qualified"), _("Stillborn"),
_("Submitted"), _("Uncleared"),
]
ssealing = [
_("<No Status>"), _("Canceled"), _("Cleared"), _("Completed"),
_("DNS"), _("Pre-1970"), _("Qualified"), _("DNS/CAN"),
_("Submitted"), _("Uncleared"),
]

View File

@ -50,6 +50,7 @@ import Errors
import RelLib import RelLib
from PluginUtils import Tool, register_tool from PluginUtils import Tool, register_tool
import const import const
import lds
import Utils import Utils
from QuestionDialog import ErrorDialog from QuestionDialog import ErrorDialog
from DateHandler import parser as _dp from DateHandler import parser as _dp
@ -819,13 +820,13 @@ class TestcaseGenerator(Tool.Tool):
#LDS #LDS
if randint(0,1) == 1: if randint(0,1) == 1:
lds = self.rand_ldsord( const.lds_baptism) lds = self.rand_ldsord( lds.baptism)
np.set_lds_baptism( lds) np.set_lds_baptism( lds)
if randint(0,1) == 1: if randint(0,1) == 1:
lds = self.rand_ldsord( const.lds_baptism) lds = self.rand_ldsord( lds.baptism)
np.set_lds_endowment( lds) np.set_lds_endowment( lds)
if randint(0,1) == 1: if randint(0,1) == 1:
lds = self.rand_ldsord( const.lds_csealing) lds = self.rand_ldsord( lds.csealing)
np.set_lds_sealing( lds) np.set_lds_sealing( lds)
person_handle = self.db.add_person(np,self.trans) person_handle = self.db.add_person(np,self.trans)
@ -879,7 +880,7 @@ class TestcaseGenerator(Tool.Tool):
fam.set_relationship( self.rand_type(Utils.family_relations)) fam.set_relationship( self.rand_type(Utils.family_relations))
else: else:
fam.set_relationship((RelLib.Family.MARRIED,'')) fam.set_relationship((RelLib.Family.MARRIED,''))
lds = self.rand_ldsord( const.lds_ssealing) lds = self.rand_ldsord( lds.ssealing)
fam.set_lds_sealing( lds) fam.set_lds_sealing( lds)
fam_h = self.db.add_family(fam,self.trans) fam_h = self.db.add_family(fam,self.trans)
fam = self.db.commit_family(fam,self.trans) fam = self.db.commit_family(fam,self.trans)
@ -946,7 +947,7 @@ class TestcaseGenerator(Tool.Tool):
fam.set_relationship( self.rand_type(Utils.family_relations)) fam.set_relationship( self.rand_type(Utils.family_relations))
else: else:
fam.set_relationship( (RelLib.Family.MARRIED,'') ) fam.set_relationship( (RelLib.Family.MARRIED,'') )
lds = self.rand_ldsord( const.lds_ssealing) lds = self.rand_ldsord( lds.ssealing)
fam.set_lds_sealing( lds) fam.set_lds_sealing( lds)
fam.add_child_handle(child_h) fam.add_child_handle(child_h)
fam_h = self.db.add_family(fam,self.trans) fam_h = self.db.add_family(fam,self.trans)
@ -1225,7 +1226,7 @@ class TestcaseGenerator(Tool.Tool):
if randint(0,1) == 1: if randint(0,1) == 1:
lds.set_status( randint(0,len(status_list)-1)) lds.set_status( randint(0,len(status_list)-1))
if randint(0,1) == 1: if randint(0,1) == 1:
lds.set_temple( choice( const.lds_temple_to_abrev.keys())) lds.set_temple( choice( lds.temple_to_abrev.keys()))
if randint(0,1) == 1: if randint(0,1) == 1:
lds.set_place_handle( self.rand_place()) lds.set_place_handle( self.rand_place())
return lds return lds