* src/const.py.in: Define integer constants for standard events.

svn: r4707
This commit is contained in:
Alex Roitman 2005-05-27 14:04:53 +00:00
parent 8d2be247db
commit 557638b510
2 changed files with 149 additions and 116 deletions

View File

@ -1,3 +1,6 @@
2005-05-27 Alex Roitman <shura@gramps-project.org>
* src/const.py.in: Define integer constants for standard events.
2005-05-27 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2005-05-27 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/RelLib.py: Add wrappers for old event handle API including a * src/RelLib.py: Add wrappers for old event handle API including a
DeprecationWarning (this makes HEAD no longer completely defunct); DeprecationWarning (this makes HEAD no longer completely defunct);

View File

@ -263,132 +263,162 @@ confidence = [
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Family event string mappings # Event constants
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
EVENT_UNKNOWN = -1
EVENT_CUSTOM = 0
EVENT_MARRIAGE = 1
EVENT_MARR_SETTL = 2
EVENT_MARR_LIC = 3
EVENT_MARR_CONTR = 4
EVENT_MARR_BANNS = 5
EVENT_ENGAGEMENT = 6
EVENT_DIVORCE = 7
EVENT_DIV_FILING = 8
EVENT_ANNULMENT = 9
EVENT_MARR_ALT = 10
EVENT_ADOPT = 11
EVENT_BIRTH = 12
EVENT_DEATH = 13
EVENT_ADULT_CHRISTEN = 14
EVENT_BAPTISM = 15
EVENT_BAR_MITZVAH = 16
EVENT_BAS_MITZVAH = 17
EVENT_BLESS = 18
EVENT_BURIAL = 19
EVENT_CAUSE_DEATH = 20
EVENT_CENSUS = 21
EVENT_CHRISTEN = 22
EVENT_CONFIRMATION = 23
EVENT_CREMATION = 24
EVENT_DEGREE = 25
EVENT_EDUCATION = 26
EVENT_ELECTED = 27
EVENT_EMIGRATION = 28
EVENT_FIRST_COMMUN = 29
EVENT_IMMIGRATION = 30
EVENT_GRADUATION = 31
EVENT_MED_INFO = 32
EVENT_MILITARY_SERV = 33
EVENT_NATURALIZATION = 34
EVENT_NOB_TITLE = 35
EVENT_NUM_MARRIAGES = 36
EVENT_OCCUPATION = 37
EVENT_ORDINATION = 38
EVENT_PROBATE = 39
EVENT_PROPERTY = 40
EVENT_RELIGION = 41
EVENT_RESIDENCE = 42
EVENT_RETIREMENT = 43
EVENT_WILL = 44
familyConstantEvents = { familyConstantEvents = {
"Annulment" : "ANUL", EVENT_ANNULMENT : "ANUL",
"Divorce Filing" : "DIVF", EVENT_DIV_FILING : "DIVF",
"Divorce" : "DIV", EVENT_DIVORCE : "DIV",
"Engagement" : "ENGA", EVENT_ENGAGEMENT : "ENGA",
"Marriage Banns" : "MARB", EVENT_MARR_BANNS : "MARB",
"Marriage Contract" : "MARC", EVENT_MARR_CONTR : "MARC",
"Marriage License" : "MARL", EVENT_MARR_LIC : "MARL",
"Marriage Settlement" : "MARS", EVENT_MARR_SETTL : "MARS",
"Marriage" : "MARR" EVENT_MARRIAGE : "MARR"
} }
#------------------------------------------------------------------------- family_events = {
# EVENT_UNKNOWN : _("Unknown"),
# EVENT_CUSTOM : _("Custom"),
# EVENT_MARRIAGE : _("Marriage"),
#------------------------------------------------------------------------- EVENT_MARR_SETTL : _("Marriage Settlement"),
EVENT_MARR_LIC : _("Marriage License"),
EVENT_MARR_CONTR : _("Marriage Contract"),
EVENT_MARR_BANNS : _("Marriage Banns"),
EVENT_ENGAGEMENT : _("Engagement"),
EVENT_DIVORCE : _("Divorce")
EVENT_DIV_FILING : _("Divorce Filing"),
EVENT_ANNULMENT : _("Annulment"),
EVENT_MARR_ALT : _("Alternate Marriage"),
}
family_events = TransTable( {
"Alternate Marriage" : _("Alternate Marriage"),
"Annulment" : _("Annulment"),
"Divorce Filing" : _("Divorce Filing"),
"Divorce" : _("Divorce"),
"Engagement" : _("Engagement"),
"Marriage Banns" : _("Marriage Banns"),
"Marriage Contract" : _("Marriage Contract"),
"Marriage License" : _("Marriage License"),
"Marriage Settlement" : _("Marriage Settlement"),
"Marriage" : _("Marriage")
})
def display_fevent(st):
return family_events.find_value(st)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
personalConstantEvents = { personalConstantEvents = {
"Adopted" : "ADOP", EVENT_ADOPT : "ADOP",
"Adult Christening" : "CHRA", EVENT_ADULT_CHRISTEN : "CHRA",
"Birth" : "BIRT", EVENT_BIRTH : "BIRT",
"Death" : "DEAT", EVENT_DEATH : "DEAT",
"Baptism" : "BAPM", EVENT_BAPTISM : "BAPM",
"Bar Mitzvah" : "BARM", EVENT_BAR_MITZVAH : "BARM",
"Bas Mitzvah" : "BASM", EVENT_BAS_MITZVAH : "BASM",
"Blessing" : "BLES", EVENT_BLESS : "BLES",
"Burial" : "BURI", EVENT_BURIAL : "BURI",
"Cause Of Death" : "CAUS", EVENT_CAUSE_DEATH : "CAUS",
"Ordination" : "ORDI", EVENT_ORDINATION : "ORDI",
"Census" : "CENS", EVENT_CENSUS : "CENS",
"Christening" : "CHR" , EVENT_CHRISTEN : "CHR" ,
"Confirmation" : "CONF", EVENT_CONFIRMATION : "CONF",
"Cremation" : "CREM", EVENT_CREMATION : "CREM",
"Degree" : "", EVENT_DEGREE : "",
"Divorce Filing" : "DIVF", EVENT_DIV_FILING : "DIVF",
"Education" : "EDUC", EVENT_EDUCATION : "EDUC",
"Elected" : "", EVENT_ELECTED : "",
"Emigration" : "EMIG", EVENT_ELECTED : "EMIG",
"First Communion" : "FCOM", EVENT_FIRST_COMMUN : "FCOM",
"Graduation" : "GRAD", EVENT_GRADUATION : "GRAD",
"Medical Information" : "", EVENT_MED_INFO : "",
"Military Service" : "", EVENT_MILITARY_SERV : "",
"Naturalization" : "NATU", EVENT_NATURALIZATION : "NATU",
"Nobility Title" : "TITL", EVENT_NOB_TITLE : "TITL",
"Number of Marriages" : "NMR", EVENT_NUM_MARRIAGES : "NMR",
"Immigration" : "IMMI", EVENT_IMMIGRATION : "IMMI",
"Occupation" : "OCCU", EVENT_OCCUPATION : "OCCU",
"Probate" : "PROB", EVENT_PROBATE : "PROB",
"Property" : "PROP", EVENT_PROPERTY : "PROP",
"Religion" : "RELI", EVENT_RELIGION : "RELI",
"Residence" : "RESI", EVENT_RESIDENCE : "RESI",
"Retirement" : "RETI", EVENT_RETIREMENT : "RETI",
"Will" : "WILL" EVENT_WILL : "WILL",
} }
#------------------------------------------------------------------------- personal_events = {
# EVENT_UNKNOWN : _("Unknown"),
# EVENT_CUSTOM : _("Custom"),
# EVENT_ADOPT : _("Adopted"),
#------------------------------------------------------------------------- EVENT_BIRTH : _("Birth"),
EVENT_DEATH : _("Death"),
EVENT_ADULT_CHRISTEN : _("Adult Christening"),
EVENT_BAPTISM : _("Baptism"),
EVENT_BAR_MITZVAH : _("Bar Mitzvah"),
EVENT_BAS_MITZVAH : _("Bas Mitzvah"),
EVENT_BLESS : _("Blessing"),
EVENT_BURIAL : _("Burial"),
EVENT_CAUSE_DEATH : _("Cause Of Death"),
EVENT_CENSUS : _("Census"),
EVENT_CHRISTEN : _("Christening"),
EVENT_CONFIRMATION : _("Confirmation"),
EVENT_CREMATION : _("Cremation"),
EVENT_DEGREE : _("Degree"),
EVENT_DIV_FILING : _("Divorce Filing"),
EVENT_EDUCATION : _("Education"),
EVENT_ELECTED : _("Elected"),
EVENT_EMIGRATION : _("Emigration"),
EVENT_FIRST_COMMUN : _("First Communion"),
EVENT_IMMIGRATION : _("Immigration"),
EVENT_GRADUATION : _("Graduation"),
EVENT_MED_INFO : _("Medical Information"),
EVENT_MILITARY_SERV : _("Military Service"),
EVENT_NATURALIZATION : _("Naturalization"),
EVENT_NOB_TITLE : _("Nobility Title"),
EVENT_NUM_MARRIAGES : _("Number of Marriages"),
EVENT_OCCUPATION : _("Occupation"),
EVENT_ORDINATION : _("Ordination"),
EVENT_PROBATE : _("Probate"),
EVENT_PROPERTY : _("Property"),
EVENT_RELIGION : _("Religion"),
EVENT_RESIDENCE : _("Residence"),
EVENT_RETIREMENT : _("Retirement"),
EVENT_WILL : _("Will")
}
personal_events = TransTable({
"Adopted" : _("Adopted"),
"Birth" : _("Birth"),
"Death" : _("Death"),
"Adult Christening" : _("Adult Christening"),
"Baptism" : _("Baptism"),
"Bar Mitzvah" : _("Bar Mitzvah"),
"Bas Mitzvah" : _("Bas Mitzvah"),
"Blessing" : _("Blessing"),
"Burial" : _("Burial"),
"Cause Of Death" : _("Cause Of Death"),
"Census" : _("Census"),
"Christening" : _("Christening"),
"Confirmation" : _("Confirmation"),
"Cremation" : _("Cremation"),
"Degree" : _("Degree"),
"Divorce Filing" : _("Divorce Filing"),
"Education" : _("Education"),
"Elected" : _("Elected"),
"Emigration" : _("Emigration"),
"First Communion" : _("First Communion"),
"Immigration" : _("Immigration"),
"Graduation" : _("Graduation"),
"Medical Information" : _("Medical Information"),
"Military Service" : _("Military Service"),
"Naturalization" : _("Naturalization"),
"Nobility Title" : _("Nobility Title"),
"Number of Marriages" : _("Number of Marriages"),
"Occupation" : _("Occupation"),
"Ordination" : _("Ordination"),
"Probate" : _("Probate"),
"Property" : _("Property"),
"Religion" : _("Religion"),
"Residence" : _("Residence"),
"Retirement" : _("Retirement"),
"Will" : _("Will")
})
def display_pevent(st):
return personal_events.find_value(st)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #