Gramps type pylint improvements
This commit is contained in:
parent
1654757c22
commit
80f05956b4
@ -23,38 +23,33 @@
|
|||||||
Provide the different Attribute Types for Gramps.
|
Provide the different Attribute Types for Gramps.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Standard Python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class AttributeType(GrampsType):
|
class AttributeType(GrampsType):
|
||||||
|
|
||||||
UNKNOWN = -1
|
UNKNOWN = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
CASTE = 1
|
CASTE = 1
|
||||||
DESCRIPTION = 2
|
DESCRIPTION = 2
|
||||||
ID = 3
|
ID = 3
|
||||||
NATIONAL = 4
|
NATIONAL = 4
|
||||||
NUM_CHILD = 5
|
NUM_CHILD = 5
|
||||||
SSN = 6
|
SSN = 6
|
||||||
NICKNAME = 7
|
NICKNAME = 7
|
||||||
CAUSE = 8
|
CAUSE = 8
|
||||||
AGENCY = 9
|
AGENCY = 9
|
||||||
AGE = 10
|
AGE = 10
|
||||||
FATHER_AGE = 11
|
FATHER_AGE = 11
|
||||||
MOTHER_AGE = 12
|
MOTHER_AGE = 12
|
||||||
WITNESS = 13
|
WITNESS = 13
|
||||||
TIME = 14
|
TIME = 14
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = ID
|
_DEFAULT = ID
|
||||||
@ -64,23 +59,22 @@ class AttributeType(GrampsType):
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
_BASEMAP = [ # allow deferred translation of attribute UI strings
|
_BASEMAP = [ # allow deferred translation of attribute UI strings
|
||||||
(UNKNOWN , _T_("Unknown"), "Unknown"),
|
(UNKNOWN, _T_("Unknown"), "Unknown"),
|
||||||
(CUSTOM , _T_("Custom"), "Custom"),
|
(CUSTOM, _T_("Custom"), "Custom"),
|
||||||
(CASTE , _T_("Caste"), "Caste"),
|
(CASTE, _T_("Caste"), "Caste"),
|
||||||
(DESCRIPTION , _T_("Description"), "Description"),
|
(DESCRIPTION, _T_("Description"), "Description"),
|
||||||
(ID , _T_("Identification Number"), "Identification Number"),
|
(ID, _T_("Identification Number"), "Identification Number"),
|
||||||
(NATIONAL , _T_("National Origin"), "National Origin"),
|
(NATIONAL, _T_("National Origin"), "National Origin"),
|
||||||
(NUM_CHILD , _T_("Number of Children"), "Number of Children"),
|
(NUM_CHILD, _T_("Number of Children"), "Number of Children"),
|
||||||
(SSN , _T_("Social Security Number"),
|
(SSN, _T_("Social Security Number"), "Social Security Number"),
|
||||||
"Social Security Number"),
|
(NICKNAME, _T_("Nickname"), "Nickname"),
|
||||||
(NICKNAME , _T_("Nickname"), "Nickname"),
|
(CAUSE, _T_("Cause"), "Cause"),
|
||||||
(CAUSE , _T_("Cause"), "Cause"),
|
(AGENCY, _T_("Agency"), "Agency"),
|
||||||
(AGENCY , _T_("Agency"), "Agency"),
|
(AGE, _T_("Age"), "Age"),
|
||||||
(AGE , _T_("Age"), "Age"),
|
(FATHER_AGE, _T_("Father's Age"), "Father Age"),
|
||||||
(FATHER_AGE , _T_("Father's Age"), "Father Age"),
|
(MOTHER_AGE, _T_("Mother's Age"), "Mother Age"),
|
||||||
(MOTHER_AGE , _T_("Mother's Age"), "Mother Age"),
|
(WITNESS, _T_("Witness"), "Witness"),
|
||||||
(WITNESS , _T_("Witness"), "Witness"),
|
(TIME, _T_("Time"), "Time"),
|
||||||
(TIME , _T_("Time"), "Time"),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
_DATAMAP = [(base[0], _(base[1]), base[2]) for base in _BASEMAP]
|
_DATAMAP = [(base[0], _(base[1]), base[2]) for base in _BASEMAP]
|
||||||
|
@ -21,13 +21,6 @@
|
|||||||
"""
|
"""
|
||||||
Provide the different child reference types.
|
Provide the different child reference types.
|
||||||
"""
|
"""
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# standard python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -35,6 +28,8 @@ _ = glocale.translation.gettext
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class ChildRefType(GrampsType):
|
class ChildRefType(GrampsType):
|
||||||
"""
|
"""
|
||||||
@ -56,31 +51,28 @@ class ChildRefType(GrampsType):
|
|||||||
.. attribute CUSTOM : Custom - a relationship given by the user
|
.. attribute CUSTOM : Custom - a relationship given by the user
|
||||||
"""
|
"""
|
||||||
|
|
||||||
NONE = 0
|
NONE = 0
|
||||||
BIRTH = 1
|
BIRTH = 1
|
||||||
ADOPTED = 2
|
ADOPTED = 2
|
||||||
STEPCHILD = 3
|
STEPCHILD = 3
|
||||||
SPONSORED = 4
|
SPONSORED = 4
|
||||||
FOSTER = 5
|
FOSTER = 5
|
||||||
UNKNOWN = 6
|
UNKNOWN = 6
|
||||||
CUSTOM = 7
|
CUSTOM = 7
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = BIRTH
|
_DEFAULT = BIRTH
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(NONE, _("None"), "None"),
|
(NONE, _("None"), "None"),
|
||||||
(BIRTH, _("Birth"), "Birth"),
|
(BIRTH, _("Birth"), "Birth"),
|
||||||
(ADOPTED, _("Adopted"), "Adopted"),
|
(ADOPTED, _("Adopted"), "Adopted"),
|
||||||
(STEPCHILD, _("Stepchild"), "Stepchild"),
|
(STEPCHILD, _("Stepchild"), "Stepchild"),
|
||||||
(SPONSORED, _("Sponsored"), "Sponsored"),
|
(SPONSORED, _("Sponsored"), "Sponsored"),
|
||||||
(FOSTER, _("Foster"), "Foster"),
|
(FOSTER, _("Foster"), "Foster"),
|
||||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||||
(CUSTOM, _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, value=None):
|
def __init__(self, value=None):
|
||||||
GrampsType.__init__(self, value)
|
GrampsType.__init__(self, value)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,49 +22,43 @@
|
|||||||
Provide the different event roles.
|
Provide the different event roles.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.sgettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.sgettext
|
||||||
|
|
||||||
class EventRoleType(GrampsType):
|
class EventRoleType(GrampsType):
|
||||||
|
|
||||||
UNKNOWN = -1
|
UNKNOWN = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
PRIMARY = 1
|
PRIMARY = 1
|
||||||
CLERGY = 2
|
CLERGY = 2
|
||||||
CELEBRANT = 3
|
CELEBRANT = 3
|
||||||
AIDE = 4
|
AIDE = 4
|
||||||
BRIDE = 5
|
BRIDE = 5
|
||||||
GROOM = 6
|
GROOM = 6
|
||||||
WITNESS = 7
|
WITNESS = 7
|
||||||
FAMILY = 8
|
FAMILY = 8
|
||||||
INFORMANT = 9
|
INFORMANT = 9
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = PRIMARY
|
_DEFAULT = PRIMARY
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||||
(CUSTOM, _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
(PRIMARY, _("Role|Primary"), "Primary"),
|
(PRIMARY, _("Role|Primary"), "Primary"),
|
||||||
(CLERGY, _("Clergy"), "Clergy"),
|
(CLERGY, _("Clergy"), "Clergy"),
|
||||||
(CELEBRANT, _("Celebrant"), "Celebrant"),
|
(CELEBRANT, _("Celebrant"), "Celebrant"),
|
||||||
(AIDE, _("Aide"), "Aide"),
|
(AIDE, _("Aide"), "Aide"),
|
||||||
(BRIDE, _("Bride"), "Bride"),
|
(BRIDE, _("Bride"), "Bride"),
|
||||||
(GROOM, _("Groom"), "Groom"),
|
(GROOM, _("Groom"), "Groom"),
|
||||||
(WITNESS, _("Witness"), "Witness"),
|
(WITNESS, _("Witness"), "Witness"),
|
||||||
(FAMILY, _("Role|Family"), "Family"),
|
(FAMILY, _("Role|Family"), "Family"),
|
||||||
(INFORMANT, _("Informant"), "Informant"),
|
(INFORMANT, _("Informant"), "Informant"),
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -82,4 +76,3 @@ class EventRoleType(GrampsType):
|
|||||||
Returns True if EventRoleType is FAMILY, False otherwise.
|
Returns True if EventRoleType is FAMILY, False otherwise.
|
||||||
"""
|
"""
|
||||||
return self.value == self.FAMILY
|
return self.value == self.FAMILY
|
||||||
|
|
||||||
|
@ -23,20 +23,14 @@
|
|||||||
Provide the different event types
|
Provide the different event types
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.sgettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.sgettext
|
||||||
|
|
||||||
class EventType(GrampsType):
|
class EventType(GrampsType):
|
||||||
"""
|
"""
|
||||||
@ -89,52 +83,52 @@ class EventType(GrampsType):
|
|||||||
.. attribute ANNULMENT: Annulment
|
.. attribute ANNULMENT: Annulment
|
||||||
.. attribute MARR_ALT: Alternate Marriage
|
.. attribute MARR_ALT: Alternate Marriage
|
||||||
"""
|
"""
|
||||||
UNKNOWN = -1
|
UNKNOWN = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
MARRIAGE = 1
|
MARRIAGE = 1
|
||||||
MARR_SETTL = 2
|
MARR_SETTL = 2
|
||||||
MARR_LIC = 3
|
MARR_LIC = 3
|
||||||
MARR_CONTR = 4
|
MARR_CONTR = 4
|
||||||
MARR_BANNS = 5
|
MARR_BANNS = 5
|
||||||
ENGAGEMENT = 6
|
ENGAGEMENT = 6
|
||||||
DIVORCE = 7
|
DIVORCE = 7
|
||||||
DIV_FILING = 8
|
DIV_FILING = 8
|
||||||
ANNULMENT = 9
|
ANNULMENT = 9
|
||||||
MARR_ALT = 10
|
MARR_ALT = 10
|
||||||
ADOPT = 11
|
ADOPT = 11
|
||||||
BIRTH = 12
|
BIRTH = 12
|
||||||
DEATH = 13
|
DEATH = 13
|
||||||
ADULT_CHRISTEN = 14
|
ADULT_CHRISTEN = 14
|
||||||
BAPTISM = 15
|
BAPTISM = 15
|
||||||
BAR_MITZVAH = 16
|
BAR_MITZVAH = 16
|
||||||
BAS_MITZVAH = 17
|
BAS_MITZVAH = 17
|
||||||
BLESS = 18
|
BLESS = 18
|
||||||
BURIAL = 19
|
BURIAL = 19
|
||||||
CAUSE_DEATH = 20
|
CAUSE_DEATH = 20
|
||||||
CENSUS = 21
|
CENSUS = 21
|
||||||
CHRISTEN = 22
|
CHRISTEN = 22
|
||||||
CONFIRMATION = 23
|
CONFIRMATION = 23
|
||||||
CREMATION = 24
|
CREMATION = 24
|
||||||
DEGREE = 25
|
DEGREE = 25
|
||||||
EDUCATION = 26
|
EDUCATION = 26
|
||||||
ELECTED = 27
|
ELECTED = 27
|
||||||
EMIGRATION = 28
|
EMIGRATION = 28
|
||||||
FIRST_COMMUN = 29
|
FIRST_COMMUN = 29
|
||||||
IMMIGRATION = 30
|
IMMIGRATION = 30
|
||||||
GRADUATION = 31
|
GRADUATION = 31
|
||||||
MED_INFO = 32
|
MED_INFO = 32
|
||||||
MILITARY_SERV = 33
|
MILITARY_SERV = 33
|
||||||
NATURALIZATION = 34
|
NATURALIZATION = 34
|
||||||
NOB_TITLE = 35
|
NOB_TITLE = 35
|
||||||
NUM_MARRIAGES = 36
|
NUM_MARRIAGES = 36
|
||||||
OCCUPATION = 37
|
OCCUPATION = 37
|
||||||
ORDINATION = 38
|
ORDINATION = 38
|
||||||
PROBATE = 39
|
PROBATE = 39
|
||||||
PROPERTY = 40
|
PROPERTY = 40
|
||||||
RELIGION = 41
|
RELIGION = 41
|
||||||
RESIDENCE = 42
|
RESIDENCE = 42
|
||||||
RETIREMENT = 43
|
RETIREMENT = 43
|
||||||
WILL = 44
|
WILL = 44
|
||||||
|
|
||||||
# _T_ is a gramps-defined keyword -- see po/update_po.py and po/genpot.sh
|
# _T_ is a gramps-defined keyword -- see po/update_po.py and po/genpot.sh
|
||||||
def _T_(value): # enable deferred translations (see Python docs 22.1.3.4)
|
def _T_(value): # enable deferred translations (see Python docs 22.1.3.4)
|
||||||
@ -142,75 +136,75 @@ class EventType(GrampsType):
|
|||||||
|
|
||||||
_MENU = [[_T_('Life Events'),
|
_MENU = [[_T_('Life Events'),
|
||||||
[BIRTH, BAPTISM, DEATH, BURIAL, CREMATION, ADOPT]],
|
[BIRTH, BAPTISM, DEATH, BURIAL, CREMATION, ADOPT]],
|
||||||
[_T_('Family'),
|
[_T_('Family'),
|
||||||
[ENGAGEMENT, MARRIAGE, DIVORCE, ANNULMENT, MARR_SETTL, MARR_LIC,
|
[ENGAGEMENT, MARRIAGE, DIVORCE, ANNULMENT, MARR_SETTL, MARR_LIC,
|
||||||
MARR_CONTR, MARR_BANNS, DIV_FILING, MARR_ALT]],
|
MARR_CONTR, MARR_BANNS, DIV_FILING, MARR_ALT]],
|
||||||
[_T_('Religious'),
|
[_T_('Religious'),
|
||||||
[CHRISTEN, ADULT_CHRISTEN, CONFIRMATION, FIRST_COMMUN, BLESS,
|
[CHRISTEN, ADULT_CHRISTEN, CONFIRMATION, FIRST_COMMUN, BLESS,
|
||||||
BAR_MITZVAH, BAS_MITZVAH, RELIGION]],
|
BAR_MITZVAH, BAS_MITZVAH, RELIGION]],
|
||||||
[_T_('Vocational'),
|
[_T_('Vocational'),
|
||||||
[OCCUPATION, RETIREMENT, ELECTED, MILITARY_SERV, ORDINATION]],
|
[OCCUPATION, RETIREMENT, ELECTED, MILITARY_SERV, ORDINATION]],
|
||||||
[_T_('Academic'),
|
[_T_('Academic'),
|
||||||
[EDUCATION, DEGREE, GRADUATION]],
|
[EDUCATION, DEGREE, GRADUATION]],
|
||||||
[_T_('Travel'),
|
[_T_('Travel'),
|
||||||
[EMIGRATION, IMMIGRATION, NATURALIZATION]],
|
[EMIGRATION, IMMIGRATION, NATURALIZATION]],
|
||||||
[_T_('Legal'),
|
[_T_('Legal'),
|
||||||
[PROBATE, WILL]],
|
[PROBATE, WILL]],
|
||||||
[_T_('Residence'),
|
[_T_('Residence'),
|
||||||
[RESIDENCE, CENSUS, PROPERTY]],
|
[RESIDENCE, CENSUS, PROPERTY]],
|
||||||
[_T_('Other'),
|
[_T_('Other'),
|
||||||
[CAUSE_DEATH, MED_INFO, NOB_TITLE, NUM_MARRIAGES]]]
|
[CAUSE_DEATH, MED_INFO, NOB_TITLE, NUM_MARRIAGES]]]
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = BIRTH
|
_DEFAULT = BIRTH
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(UNKNOWN , _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||||
(CUSTOM , _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
(ADOPT , _("Adopted"), "Adopted"),
|
(ADOPT, _("Adopted"), "Adopted"),
|
||||||
(BIRTH , _("Birth"), "Birth"),
|
(BIRTH, _("Birth"), "Birth"),
|
||||||
(DEATH , _("Death"), "Death"),
|
(DEATH, _("Death"), "Death"),
|
||||||
(ADULT_CHRISTEN , _("Adult Christening"), "Adult Christening"),
|
(ADULT_CHRISTEN, _("Adult Christening"), "Adult Christening"),
|
||||||
(BAPTISM , _("Baptism"), "Baptism"),
|
(BAPTISM, _("Baptism"), "Baptism"),
|
||||||
(BAR_MITZVAH , _("Bar Mitzvah"), "Bar Mitzvah"),
|
(BAR_MITZVAH, _("Bar Mitzvah"), "Bar Mitzvah"),
|
||||||
(BAS_MITZVAH , _("Bat Mitzvah"), "Bas Mitzvah"),
|
(BAS_MITZVAH, _("Bat Mitzvah"), "Bas Mitzvah"),
|
||||||
(BLESS , _("Blessing"), "Blessing"),
|
(BLESS, _("Blessing"), "Blessing"),
|
||||||
(BURIAL , _("Burial"), "Burial"),
|
(BURIAL, _("Burial"), "Burial"),
|
||||||
(CAUSE_DEATH , _("Cause Of Death"), "Cause Of Death"),
|
(CAUSE_DEATH, _("Cause Of Death"), "Cause Of Death"),
|
||||||
(CENSUS , _("Census"), "Census"),
|
(CENSUS, _("Census"), "Census"),
|
||||||
(CHRISTEN , _("Christening"), "Christening"),
|
(CHRISTEN, _("Christening"), "Christening"),
|
||||||
(CONFIRMATION , _("Confirmation"), "Confirmation"),
|
(CONFIRMATION, _("Confirmation"), "Confirmation"),
|
||||||
(CREMATION , _("Cremation"), "Cremation"),
|
(CREMATION, _("Cremation"), "Cremation"),
|
||||||
(DEGREE , _("Degree"), "Degree"),
|
(DEGREE, _("Degree"), "Degree"),
|
||||||
(EDUCATION , _("Education"), "Education"),
|
(EDUCATION, _("Education"), "Education"),
|
||||||
(ELECTED , _("Elected"), "Elected"),
|
(ELECTED, _("Elected"), "Elected"),
|
||||||
(EMIGRATION , _("Emigration"), "Emigration"),
|
(EMIGRATION, _("Emigration"), "Emigration"),
|
||||||
(FIRST_COMMUN , _("First Communion"), "First Communion"),
|
(FIRST_COMMUN, _("First Communion"), "First Communion"),
|
||||||
(IMMIGRATION , _("Immigration"), "Immigration"),
|
(IMMIGRATION, _("Immigration"), "Immigration"),
|
||||||
(GRADUATION , _("Graduation"), "Graduation"),
|
(GRADUATION, _("Graduation"), "Graduation"),
|
||||||
(MED_INFO , _("Medical Information"), "Medical Information"),
|
(MED_INFO, _("Medical Information"), "Medical Information"),
|
||||||
(MILITARY_SERV , _("Military Service"), "Military Service"),
|
(MILITARY_SERV, _("Military Service"), "Military Service"),
|
||||||
(NATURALIZATION , _("Naturalization"), "Naturalization"),
|
(NATURALIZATION, _("Naturalization"), "Naturalization"),
|
||||||
(NOB_TITLE , _("Nobility Title"), "Nobility Title"),
|
(NOB_TITLE, _("Nobility Title"), "Nobility Title"),
|
||||||
(NUM_MARRIAGES , _("Number of Marriages"), "Number of Marriages"),
|
(NUM_MARRIAGES, _("Number of Marriages"), "Number of Marriages"),
|
||||||
(OCCUPATION , _("Occupation"), "Occupation"),
|
(OCCUPATION, _("Occupation"), "Occupation"),
|
||||||
(ORDINATION , _("Ordination"), "Ordination"),
|
(ORDINATION, _("Ordination"), "Ordination"),
|
||||||
(PROBATE , _("Probate"), "Probate"),
|
(PROBATE, _("Probate"), "Probate"),
|
||||||
(PROPERTY , _("Property"), "Property"),
|
(PROPERTY, _("Property"), "Property"),
|
||||||
(RELIGION , _("Religion"), "Religion"),
|
(RELIGION, _("Religion"), "Religion"),
|
||||||
(RESIDENCE , _("Residence"), "Residence"),
|
(RESIDENCE, _("Residence"), "Residence"),
|
||||||
(RETIREMENT , _("Retirement"), "Retirement"),
|
(RETIREMENT, _("Retirement"), "Retirement"),
|
||||||
(WILL , _("Will"), "Will"),
|
(WILL, _("Will"), "Will"),
|
||||||
(MARRIAGE , _("Marriage"), "Marriage"),
|
(MARRIAGE, _("Marriage"), "Marriage"),
|
||||||
(MARR_SETTL , _("Marriage Settlement"), "Marriage Settlement"),
|
(MARR_SETTL, _("Marriage Settlement"), "Marriage Settlement"),
|
||||||
(MARR_LIC , _("Marriage License"), "Marriage License"),
|
(MARR_LIC, _("Marriage License"), "Marriage License"),
|
||||||
(MARR_CONTR , _("Marriage Contract"), "Marriage Contract"),
|
(MARR_CONTR, _("Marriage Contract"), "Marriage Contract"),
|
||||||
(MARR_BANNS , _("Marriage Banns"), "Marriage Banns"),
|
(MARR_BANNS, _("Marriage Banns"), "Marriage Banns"),
|
||||||
(ENGAGEMENT , _("Engagement"), "Engagement"),
|
(ENGAGEMENT, _("Engagement"), "Engagement"),
|
||||||
(DIVORCE , _("Divorce"), "Divorce"),
|
(DIVORCE, _("Divorce"), "Divorce"),
|
||||||
(DIV_FILING , _("Divorce Filing"), "Divorce Filing"),
|
(DIV_FILING, _("Divorce Filing"), "Divorce Filing"),
|
||||||
(ANNULMENT , _("Annulment"), "Annulment"),
|
(ANNULMENT, _("Annulment"), "Annulment"),
|
||||||
(MARR_ALT , _("Alternate Marriage"), "Alternate Marriage"),
|
(MARR_ALT, _("Alternate Marriage"), "Alternate Marriage"),
|
||||||
]
|
]
|
||||||
|
|
||||||
_ABBREVIATIONS = {
|
_ABBREVIATIONS = {
|
||||||
@ -367,6 +361,7 @@ class EventType(GrampsType):
|
|||||||
else:
|
else:
|
||||||
abbrev = str(self)
|
abbrev = str(self)
|
||||||
if " " in abbrev:
|
if " " in abbrev:
|
||||||
return ".".join([letter[0].lower() for letter in abbrev.split()]) + "."
|
return ".".join([letter[0].lower()
|
||||||
|
for letter in abbrev.split()]) + "."
|
||||||
else:
|
else:
|
||||||
return abbrev[:3].lower() + "."
|
return abbrev[:3].lower() + "."
|
||||||
|
@ -21,13 +21,6 @@
|
|||||||
"""
|
"""
|
||||||
Provide the different family reference types.
|
Provide the different family reference types.
|
||||||
"""
|
"""
|
||||||
#------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -36,24 +29,26 @@ _ = glocale.translation.gettext
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
from ..config import config
|
from ..config import config
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class FamilyRelType(GrampsType):
|
class FamilyRelType(GrampsType):
|
||||||
|
|
||||||
MARRIED = 0
|
MARRIED = 0
|
||||||
UNMARRIED = 1
|
UNMARRIED = 1
|
||||||
CIVIL_UNION = 2
|
CIVIL_UNION = 2
|
||||||
UNKNOWN = 3
|
UNKNOWN = 3
|
||||||
CUSTOM = 4
|
CUSTOM = 4
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = MARRIED
|
_DEFAULT = MARRIED
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||||
(CUSTOM, _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
(CIVIL_UNION, _("Civil Union"), "Civil Union"),
|
(CIVIL_UNION, _("Civil Union"), "Civil Union"),
|
||||||
(UNMARRIED, _("Unmarried"), "Unmarried"),
|
(UNMARRIED, _("Unmarried"), "Unmarried"),
|
||||||
(MARRIED, _("Married"), "Married"),
|
(MARRIED, _("Married"), "Married"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, value=None):
|
def __init__(self, value=None):
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
Base type for all gramps types.
|
Base type for all gramps types.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -54,7 +53,7 @@ class GrampsTypeMeta(type):
|
|||||||
"""
|
"""
|
||||||
if blacklist:
|
if blacklist:
|
||||||
return dict([(item[key_col], item[data_col])
|
return dict([(item[key_col], item[data_col])
|
||||||
for item in data if not item[0] in blacklist])
|
for item in data if item[0] not in blacklist])
|
||||||
else:
|
else:
|
||||||
return dict([(item[key_col], item[data_col]) for item in data])
|
return dict([(item[key_col], item[data_col]) for item in data])
|
||||||
|
|
||||||
@ -69,16 +68,12 @@ class GrampsTypeMeta(type):
|
|||||||
cls._E2IMAP = init_map(cls._DATAMAP, 2, 0, cls._BLACKLIST)
|
cls._E2IMAP = init_map(cls._DATAMAP, 2, 0, cls._BLACKLIST)
|
||||||
|
|
||||||
|
|
||||||
# Python 2 and 3 metaclass children classes
|
|
||||||
GrampsTypeC = GrampsTypeMeta(str('GrampsTypeC'), (object, ), {})
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# GrampsType class
|
# GrampsType class
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
## python 3: class GrampsType(object, metaclass=GrampsTypeMeta):
|
class GrampsType(object, metaclass=GrampsTypeMeta):
|
||||||
class GrampsType(GrampsTypeC):
|
|
||||||
"""Base class for all Gramps object types.
|
"""Base class for all Gramps object types.
|
||||||
|
|
||||||
:cvar _DATAMAP:
|
:cvar _DATAMAP:
|
||||||
@ -108,7 +103,11 @@ class GrampsType(GrampsTypeC):
|
|||||||
|
|
||||||
_DATAMAP = []
|
_DATAMAP = []
|
||||||
_BLACKLIST = None
|
_BLACKLIST = None
|
||||||
_MENU = None
|
_I2SMAP = {}
|
||||||
|
_S2IMAP = {}
|
||||||
|
_I2EMAP = {}
|
||||||
|
_E2IMAP = {}
|
||||||
|
_MENU = []
|
||||||
__slots__ = ('__value', '__string')
|
__slots__ = ('__value', '__string')
|
||||||
|
|
||||||
def __getstate__(self):
|
def __getstate__(self):
|
||||||
@ -126,7 +125,10 @@ class GrampsType(GrampsTypeC):
|
|||||||
Create a new type, initialize the value from one of several possible
|
Create a new type, initialize the value from one of several possible
|
||||||
states.
|
states.
|
||||||
"""
|
"""
|
||||||
self.set(value)
|
self.__value = self._DEFAULT
|
||||||
|
self.__string = ''
|
||||||
|
if value is not None:
|
||||||
|
self.set(value)
|
||||||
|
|
||||||
def __set_tuple(self, value):
|
def __set_tuple(self, value):
|
||||||
"Set the value/string properties from a tuple."
|
"Set the value/string properties from a tuple."
|
||||||
@ -238,7 +240,8 @@ class GrampsType(GrampsTypeC):
|
|||||||
"""
|
"""
|
||||||
default = cls()
|
default = cls()
|
||||||
if struct.get("value", cls._CUSTOM) == cls._CUSTOM:
|
if struct.get("value", cls._CUSTOM) == cls._CUSTOM:
|
||||||
return (struct.get("value", default.value), struct.get("string", ""))
|
return (struct.get("value", default.value),
|
||||||
|
struct.get("string", ""))
|
||||||
else:
|
else:
|
||||||
return (struct.get("value", default.value), '')
|
return (struct.get("value", default.value), '')
|
||||||
|
|
||||||
@ -283,7 +286,7 @@ class GrampsType(GrampsTypeC):
|
|||||||
def get_menu(self):
|
def get_menu(self):
|
||||||
"""Return the list of localized names for the menu."""
|
"""Return the list of localized names for the menu."""
|
||||||
if self._MENU:
|
if self._MENU:
|
||||||
return [[_(i),s] for (i, s) in self._MENU]
|
return [[_(i), s] for (i, s) in self._MENU]
|
||||||
return self._MENU
|
return self._MENU
|
||||||
|
|
||||||
def get_menu_standard_xml(self):
|
def get_menu_standard_xml(self):
|
||||||
@ -312,28 +315,5 @@ class GrampsType(GrampsTypeC):
|
|||||||
def __ne__(self, value):
|
def __ne__(self, value):
|
||||||
return not self.__eq__(value)
|
return not self.__eq__(value)
|
||||||
|
|
||||||
## Python 3 does not have __cmp__
|
|
||||||
## def __cmp__(self, value):
|
|
||||||
## print ('cmp', type(value), str)
|
|
||||||
## if isinstance(value, int):
|
|
||||||
## return cmp(self.__value, value)
|
|
||||||
## elif isinstance(value, str):
|
|
||||||
## print('ok!')
|
|
||||||
## if self.__value == self._CUSTOM:
|
|
||||||
## return cmp(self.__string, value)
|
|
||||||
## else:
|
|
||||||
## print (self._I2SMAP.get(self.__value), value, cmp(self._I2SMAP.get(self.__value), value))
|
|
||||||
## return cmp(self._I2SMAP.get(self.__value), value)
|
|
||||||
## elif isinstance(value, tuple):
|
|
||||||
## if self.__value == self._CUSTOM:
|
|
||||||
## return cmp((self.__value, self.__string), value)
|
|
||||||
## else:
|
|
||||||
## return cmp(self.__value, value[0])
|
|
||||||
## else:
|
|
||||||
## if value.value == self._CUSTOM:
|
|
||||||
## return cmp(self.__string, value.string)
|
|
||||||
## else:
|
|
||||||
## return cmp(self.__value, value.value)
|
|
||||||
|
|
||||||
value = property(__int__, __set_int, None, "Returns or sets integer value")
|
value = property(__int__, __set_int, None, "Returns or sets integer value")
|
||||||
string = property(__str__, __set_str, None, "Returns or sets string value")
|
string = property(__str__, __set_str, None, "Returns or sets string value")
|
||||||
|
@ -25,41 +25,34 @@ From version 3.3 onwards, this is only kept to convert markers into tags
|
|||||||
when loading old database files.
|
when loading old database files.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class MarkerType(GrampsType):
|
class MarkerType(GrampsType):
|
||||||
"""
|
"""
|
||||||
Class for handling data markers.
|
Class for handling data markers.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
NONE = -1
|
NONE = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
COMPLETE = 1
|
COMPLETE = 1
|
||||||
TODO_TYPE = 2
|
TODO_TYPE = 2
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = NONE
|
_DEFAULT = NONE
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(NONE, "", ""),
|
(NONE, "", ""),
|
||||||
(CUSTOM, _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
(COMPLETE, _("Complete"), "Complete"),
|
(COMPLETE, _("Complete"), "Complete"),
|
||||||
(TODO_TYPE, _("ToDo"), "ToDo"),
|
(TODO_TYPE, _("ToDo"), "ToDo"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, value=None):
|
def __init__(self, value=None):
|
||||||
GrampsType.__init__(self, value)
|
GrampsType.__init__(self, value)
|
||||||
|
|
||||||
|
@ -22,20 +22,14 @@
|
|||||||
Name types.
|
Name types.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.sgettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.sgettext
|
||||||
|
|
||||||
class NameOriginType(GrampsType):
|
class NameOriginType(GrampsType):
|
||||||
"""
|
"""
|
||||||
@ -57,41 +51,40 @@ class NameOriginType(GrampsType):
|
|||||||
.. attribute LOCATION: name follows from the location of the person
|
.. attribute LOCATION: name follows from the location of the person
|
||||||
"""
|
"""
|
||||||
|
|
||||||
UNKNOWN = -1
|
UNKNOWN = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
NONE = 1
|
NONE = 1
|
||||||
INHERITED = 2
|
INHERITED = 2
|
||||||
GIVEN = 3
|
GIVEN = 3
|
||||||
TAKEN = 4
|
TAKEN = 4
|
||||||
PATRONYMIC = 5
|
PATRONYMIC = 5
|
||||||
MATRONYMIC = 6
|
MATRONYMIC = 6
|
||||||
FEUDAL = 7
|
FEUDAL = 7
|
||||||
PSEUDONYM = 8
|
PSEUDONYM = 8
|
||||||
PATRILINEAL= 9
|
PATRILINEAL = 9
|
||||||
MATRILINEAL= 10
|
MATRILINEAL = 10
|
||||||
OCCUPATION = 11
|
OCCUPATION = 11
|
||||||
LOCATION = 12
|
LOCATION = 12
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = NONE
|
_DEFAULT = NONE
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(UNKNOWN , _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown "),
|
||||||
(CUSTOM , _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
(NONE , "", ""),
|
(NONE, "", ""),
|
||||||
(INHERITED , _("Surname|Inherited"), "Inherited"),
|
(INHERITED, _("Surname|Inherited"), "Inherited"),
|
||||||
(GIVEN , _("Surname|Given"), "Given"),
|
(GIVEN, _("Surname|Given"), "Given"),
|
||||||
(TAKEN , _("Surname|Taken"), "Taken"),
|
(TAKEN, _("Surname|Taken"), "Taken"),
|
||||||
(PATRONYMIC , _("Patronymic"), "Patronymic"),
|
(PATRONYMIC, _("Patronymic"), "Patronymic"),
|
||||||
(MATRONYMIC , _("Matronymic"), "Matronymic"),
|
(MATRONYMIC, _("Matronymic"), "Matronymic"),
|
||||||
(FEUDAL , _("Surname|Feudal"), "Feudal"),
|
(FEUDAL, _("Surname|Feudal"), "Feudal"),
|
||||||
(PSEUDONYM , _("Pseudonym"), "Pseudonym"),
|
(PSEUDONYM, _("Pseudonym"), "Pseudonym"),
|
||||||
(PATRILINEAL, _("Patrilineal"), "Patrilineal"),
|
(PATRILINEAL, _("Patrilineal"), "Patrilineal"),
|
||||||
(MATRILINEAL, _("Matrilineal"), "Matrilineal"),
|
(MATRILINEAL, _("Matrilineal"), "Matrilineal"),
|
||||||
(OCCUPATION , _("Occupation"), "Occupation"),
|
(OCCUPATION, _("Occupation"), "Occupation"),
|
||||||
(LOCATION , _("Location"), "Location"),
|
(LOCATION, _("Location"), "Location"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, value=None):
|
def __init__(self, value=None):
|
||||||
GrampsType.__init__(self, value)
|
GrampsType.__init__(self, value)
|
||||||
|
|
||||||
|
@ -22,40 +22,33 @@
|
|||||||
Name types.
|
Name types.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class NameType(GrampsType):
|
class NameType(GrampsType):
|
||||||
|
|
||||||
UNKNOWN = -1
|
UNKNOWN = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
AKA = 1
|
AKA = 1
|
||||||
BIRTH = 2
|
BIRTH = 2
|
||||||
MARRIED = 3
|
MARRIED = 3
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = BIRTH
|
_DEFAULT = BIRTH
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||||
(CUSTOM, _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
(AKA, _("Also Known As"), "Also Known As"),
|
(AKA, _("Also Known As"), "Also Known As"),
|
||||||
(BIRTH, _("Birth Name"), "Birth Name"),
|
(BIRTH, _("Birth Name"), "Birth Name"),
|
||||||
(MARRIED, _("Married Name"), "Married Name"),
|
(MARRIED, _("Married Name"), "Married Name"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, value=None):
|
def __init__(self, value=None):
|
||||||
GrampsType.__init__(self, value)
|
GrampsType.__init__(self, value)
|
||||||
|
|
||||||
|
@ -27,85 +27,77 @@ Note types.
|
|||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
from .grampstype import GrampsType
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.sgettext
|
_ = glocale.translation.sgettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Gramps modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
from .grampstype import GrampsType
|
|
||||||
|
|
||||||
class NoteType(GrampsType):
|
class NoteType(GrampsType):
|
||||||
|
|
||||||
UNKNOWN = -1
|
UNKNOWN = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
GENERAL = 1
|
GENERAL = 1
|
||||||
RESEARCH = 2
|
RESEARCH = 2
|
||||||
TRANSCRIPT = 3
|
TRANSCRIPT = 3
|
||||||
#per object with notes a Type to distinguish the notes
|
#per object with notes a Type to distinguish the notes
|
||||||
PERSON = 4
|
PERSON = 4
|
||||||
ATTRIBUTE = 5
|
ATTRIBUTE = 5
|
||||||
ADDRESS = 6
|
ADDRESS = 6
|
||||||
ASSOCIATION = 7
|
ASSOCIATION = 7
|
||||||
LDS = 8
|
LDS = 8
|
||||||
FAMILY = 9
|
FAMILY = 9
|
||||||
EVENT = 10
|
EVENT = 10
|
||||||
EVENTREF = 11
|
EVENTREF = 11
|
||||||
SOURCE = 12
|
SOURCE = 12
|
||||||
SOURCEREF = 13
|
SOURCEREF = 13
|
||||||
PLACE = 14
|
PLACE = 14
|
||||||
REPO = 15
|
REPO = 15
|
||||||
REPOREF = 16
|
REPOREF = 16
|
||||||
MEDIA = 17
|
MEDIA = 17
|
||||||
MEDIAREF = 18
|
MEDIAREF = 18
|
||||||
CHILDREF = 19
|
CHILDREF = 19
|
||||||
PERSONNAME = 20
|
PERSONNAME = 20
|
||||||
# other common types
|
# other common types
|
||||||
SOURCE_TEXT = 21 # this is used for verbatim source text in SourceRef
|
SOURCE_TEXT = 21 # this is used for verbatim source text in SourceRef
|
||||||
CITATION = 22
|
CITATION = 22
|
||||||
REPORT_TEXT = 23 # this is used for notes used for reports
|
REPORT_TEXT = 23 # this is used for notes used for reports
|
||||||
# indicate a note is html code
|
# indicate a note is html code
|
||||||
HTML_CODE = 24
|
HTML_CODE = 24
|
||||||
TODO = 25
|
TODO = 25
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = GENERAL
|
_DEFAULT = GENERAL
|
||||||
|
|
||||||
|
|
||||||
_DATAMAPREAL = [
|
_DATAMAPREAL = [
|
||||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||||
(CUSTOM, _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
(GENERAL, _("General"), "General"),
|
(GENERAL, _("General"), "General"),
|
||||||
(RESEARCH, _("Research"), "Research"),
|
(RESEARCH, _("Research"), "Research"),
|
||||||
(TRANSCRIPT, _("Transcript"), "Transcript"),
|
(TRANSCRIPT, _("Transcript"), "Transcript"),
|
||||||
(SOURCE_TEXT, _("Source text"), "Source text"),
|
(SOURCE_TEXT, _("Source text"), "Source text"),
|
||||||
(CITATION, _('Citation'), "Citation"),
|
(CITATION, _('Citation'), "Citation"),
|
||||||
(REPORT_TEXT, _("Report"), "Report"),
|
(REPORT_TEXT, _("Report"), "Report"),
|
||||||
(HTML_CODE, _("Html code"), "Html code"),
|
(HTML_CODE, _("Html code"), "Html code"),
|
||||||
(TODO, _("notetype|To Do"), "To Do"),
|
(TODO, _("notetype|To Do"), "To Do"),
|
||||||
]
|
]
|
||||||
|
|
||||||
_DATAMAPIGNORE = [
|
_DATAMAPIGNORE = [
|
||||||
(PERSON, _("Person Note"),"Person Note"),
|
(PERSON, _("Person Note"), "Person Note"),
|
||||||
(PERSONNAME, _("Name Note"), "Name Note"),
|
(PERSONNAME, _("Name Note"), "Name Note"),
|
||||||
(ATTRIBUTE, _("Attribute Note"), "Attribute Note"),
|
(ATTRIBUTE, _("Attribute Note"), "Attribute Note"),
|
||||||
(ADDRESS, _("Address Note"), "Address Note"),
|
(ADDRESS, _("Address Note"), "Address Note"),
|
||||||
(ASSOCIATION,_("Association Note"), "Association Note"),
|
(ASSOCIATION, _("Association Note"), "Association Note"),
|
||||||
(LDS, _("LDS Note"), "LDS Note"),
|
(LDS, _("LDS Note"), "LDS Note"),
|
||||||
(FAMILY, _("Family Note"),"Family Note"),
|
(FAMILY, _("Family Note"), "Family Note"),
|
||||||
(EVENT, _("Event Note"), "Event Note"),
|
(EVENT, _("Event Note"), "Event Note"),
|
||||||
(EVENTREF, _("Event Reference Note"), "Event Reference Note"),
|
(EVENTREF, _("Event Reference Note"), "Event Reference Note"),
|
||||||
(SOURCE, _("Source Note"), "Source Note"),
|
(SOURCE, _("Source Note"), "Source Note"),
|
||||||
(SOURCEREF, _("Source Reference Note"), "Source Reference Note"),
|
(SOURCEREF, _("Source Reference Note"), "Source Reference Note"),
|
||||||
(PLACE, _("Place Note"), "Place Note"),
|
(PLACE, _("Place Note"), "Place Note"),
|
||||||
(REPO, _("Repository Note"), "Repository Note"),
|
(REPO, _("Repository Note"), "Repository Note"),
|
||||||
(REPOREF, _("Repository Reference Note"),
|
(REPOREF, _("Repository Reference Note"), "Repository Reference Note"),
|
||||||
"Repository Reference Note"),
|
(MEDIA, _("Media Note"), "Media Note"),
|
||||||
(MEDIA, _("Media Note"), "Media Note"),
|
(MEDIAREF, _("Media Reference Note"), "Media Reference Note"),
|
||||||
(MEDIAREF, _("Media Reference Note"), "Media Reference Note"),
|
(CHILDREF, _("Child Reference Note"), "Child Reference Note"),
|
||||||
(CHILDREF, _("Child Reference Note"), "Child Reference Note"),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
_DATAMAP = _DATAMAPREAL + _DATAMAPIGNORE
|
_DATAMAP = _DATAMAPREAL + _DATAMAPIGNORE
|
||||||
|
@ -21,13 +21,6 @@
|
|||||||
"""
|
"""
|
||||||
Provide the different place types.
|
Provide the different place types.
|
||||||
"""
|
"""
|
||||||
#------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -35,58 +28,60 @@ _ = glocale.translation.gettext
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class PlaceType(GrampsType):
|
class PlaceType(GrampsType):
|
||||||
|
|
||||||
UNKNOWN = -1
|
UNKNOWN = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
COUNTRY = 1
|
COUNTRY = 1
|
||||||
STATE = 2
|
STATE = 2
|
||||||
COUNTY = 3
|
COUNTY = 3
|
||||||
CITY = 4
|
CITY = 4
|
||||||
PARISH = 5
|
PARISH = 5
|
||||||
LOCALITY = 6
|
LOCALITY = 6
|
||||||
STREET = 7
|
STREET = 7
|
||||||
PROVINCE = 8
|
PROVINCE = 8
|
||||||
REGION = 9
|
REGION = 9
|
||||||
DEPARTMENT = 10
|
DEPARTMENT = 10
|
||||||
NEIGHBORHOOD = 11
|
NEIGHBORHOOD = 11
|
||||||
DISTRICT = 12
|
DISTRICT = 12
|
||||||
BOROUGH = 13
|
BOROUGH = 13
|
||||||
MUNICIPALITY = 14
|
MUNICIPALITY = 14
|
||||||
TOWN = 15
|
TOWN = 15
|
||||||
VILLAGE = 16
|
VILLAGE = 16
|
||||||
HAMLET = 17
|
HAMLET = 17
|
||||||
FARM = 18
|
FARM = 18
|
||||||
BUILDING = 19
|
BUILDING = 19
|
||||||
NUMBER = 20
|
NUMBER = 20
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = UNKNOWN
|
_DEFAULT = UNKNOWN
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||||
(CUSTOM, _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
(COUNTRY, _("Country"), "Country"),
|
(COUNTRY, _("Country"), "Country"),
|
||||||
(STATE, _("State"), "State"),
|
(STATE, _("State"), "State"),
|
||||||
(COUNTY, _("County"), "County"),
|
(COUNTY, _("County"), "County"),
|
||||||
(CITY, _("City"), "City"),
|
(CITY, _("City"), "City"),
|
||||||
(PARISH, _("Parish"), "Parish"),
|
(PARISH, _("Parish"), "Parish"),
|
||||||
(LOCALITY, _("Locality"), "Locality"),
|
(LOCALITY, _("Locality"), "Locality"),
|
||||||
(STREET, _("Street"), "Street"),
|
(STREET, _("Street"), "Street"),
|
||||||
(PROVINCE, _("Province"), "Province"),
|
(PROVINCE, _("Province"), "Province"),
|
||||||
(REGION, _("Region"), "Region"),
|
(REGION, _("Region"), "Region"),
|
||||||
(DEPARTMENT, _("Department"), "Department"),
|
(DEPARTMENT, _("Department"), "Department"),
|
||||||
(NEIGHBORHOOD, _("Neighborhood"), "Neighborhood"),
|
(NEIGHBORHOOD, _("Neighborhood"), "Neighborhood"),
|
||||||
(DISTRICT, _("District"), "District"),
|
(DISTRICT, _("District"), "District"),
|
||||||
(BOROUGH, _("Borough"), "Borough"),
|
(BOROUGH, _("Borough"), "Borough"),
|
||||||
(MUNICIPALITY, _("Municipality"), "Municipality"),
|
(MUNICIPALITY, _("Municipality"), "Municipality"),
|
||||||
(TOWN, _("Town"), "Town"),
|
(TOWN, _("Town"), "Town"),
|
||||||
(VILLAGE, _("Village"), "Village"),
|
(VILLAGE, _("Village"), "Village"),
|
||||||
(HAMLET, _("Hamlet"), "Hamlet"),
|
(HAMLET, _("Hamlet"), "Hamlet"),
|
||||||
(FARM, _("Farm"), "Farm"),
|
(FARM, _("Farm"), "Farm"),
|
||||||
(BUILDING, _("Building"), "Building"),
|
(BUILDING, _("Building"), "Building"),
|
||||||
(NUMBER, _("Number"), "Number"),
|
(NUMBER, _("Number"), "Number"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, value=None):
|
def __init__(self, value=None):
|
||||||
|
@ -22,52 +22,45 @@
|
|||||||
Repository types.
|
Repository types.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class RepositoryType(GrampsType):
|
class RepositoryType(GrampsType):
|
||||||
|
|
||||||
UNKNOWN = -1
|
UNKNOWN = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
LIBRARY = 1
|
LIBRARY = 1
|
||||||
CEMETERY = 2
|
CEMETERY = 2
|
||||||
CHURCH = 3
|
CHURCH = 3
|
||||||
ARCHIVE = 4
|
ARCHIVE = 4
|
||||||
ALBUM = 5
|
ALBUM = 5
|
||||||
WEBSITE = 6
|
WEBSITE = 6
|
||||||
BOOKSTORE = 7
|
BOOKSTORE = 7
|
||||||
COLLECTION = 8
|
COLLECTION = 8
|
||||||
SAFE = 9
|
SAFE = 9
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = LIBRARY
|
_DEFAULT = LIBRARY
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||||
(CUSTOM, _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
(LIBRARY, _("Library"), "Library"),
|
(LIBRARY, _("Library"), "Library"),
|
||||||
(CEMETERY, _("Cemetery"), "Cemetery"),
|
(CEMETERY, _("Cemetery"), "Cemetery"),
|
||||||
(CHURCH, _("Church"), "Church"),
|
(CHURCH, _("Church"), "Church"),
|
||||||
(ARCHIVE, _("Archive"), "Archive"),
|
(ARCHIVE, _("Archive"), "Archive"),
|
||||||
(ALBUM, _("Album"), "Album"),
|
(ALBUM, _("Album"), "Album"),
|
||||||
(WEBSITE, _("Web site"), "Web site"),
|
(WEBSITE, _("Web site"), "Web site"),
|
||||||
(BOOKSTORE, _("Bookstore"), "Bookstore"),
|
(BOOKSTORE, _("Bookstore"), "Bookstore"),
|
||||||
(COLLECTION, _("Collection"), "Collection"),
|
(COLLECTION, _("Collection"), "Collection"),
|
||||||
(SAFE, _("Safe"), "Safe"),
|
(SAFE, _("Safe"), "Safe"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, value=None):
|
def __init__(self, value=None):
|
||||||
GrampsType.__init__(self, value)
|
GrampsType.__init__(self, value)
|
||||||
|
|
||||||
|
@ -22,32 +22,26 @@
|
|||||||
Provide the different Source Attribute Types for Gramps.
|
Provide the different Source Attribute Types for Gramps.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Standard Python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class SrcAttributeType(GrampsType):
|
class SrcAttributeType(GrampsType):
|
||||||
|
|
||||||
UNKNOWN = -1
|
UNKNOWN = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = UNKNOWN
|
_DEFAULT = UNKNOWN
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(UNKNOWN , _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||||
(CUSTOM , _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, value=None):
|
def __init__(self, value=None):
|
||||||
|
@ -22,58 +22,52 @@
|
|||||||
SourceMedia types.
|
SourceMedia types.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class SourceMediaType(GrampsType):
|
class SourceMediaType(GrampsType):
|
||||||
|
|
||||||
UNKNOWN = -1
|
UNKNOWN = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
AUDIO = 1
|
AUDIO = 1
|
||||||
BOOK = 2
|
BOOK = 2
|
||||||
CARD = 3
|
CARD = 3
|
||||||
ELECTRONIC = 4
|
ELECTRONIC = 4
|
||||||
FICHE = 5
|
FICHE = 5
|
||||||
FILM = 6
|
FILM = 6
|
||||||
MAGAZINE = 7
|
MAGAZINE = 7
|
||||||
MANUSCRIPT = 8
|
MANUSCRIPT = 8
|
||||||
MAP = 9
|
MAP = 9
|
||||||
NEWSPAPER = 10
|
NEWSPAPER = 10
|
||||||
PHOTO = 11
|
PHOTO = 11
|
||||||
TOMBSTONE = 12
|
TOMBSTONE = 12
|
||||||
VIDEO = 13
|
VIDEO = 13
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = BOOK
|
_DEFAULT = BOOK
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||||
(CUSTOM, _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
(AUDIO, _("Audio"), "Audio"),
|
(AUDIO, _("Audio"), "Audio"),
|
||||||
(BOOK, _("Book"), "Book"),
|
(BOOK, _("Book"), "Book"),
|
||||||
(CARD, _("Card"), "Card"),
|
(CARD, _("Card"), "Card"),
|
||||||
(ELECTRONIC, _("Electronic"), "Electronic"),
|
(ELECTRONIC, _("Electronic"), "Electronic"),
|
||||||
(FICHE, _("Fiche"), "Fiche"),
|
(FICHE, _("Fiche"), "Fiche"),
|
||||||
(FILM, _("Film"), "Film"),
|
(FILM, _("Film"), "Film"),
|
||||||
(MAGAZINE, _("Magazine"), "Magazine"),
|
(MAGAZINE, _("Magazine"), "Magazine"),
|
||||||
(MANUSCRIPT, _("Manuscript"), "Manuscript"),
|
(MANUSCRIPT, _("Manuscript"), "Manuscript"),
|
||||||
(MAP, _("Map"), "Map"),
|
(MAP, _("Map"), "Map"),
|
||||||
(NEWSPAPER, _("Newspaper"), "Newspaper"),
|
(NEWSPAPER, _("Newspaper"), "Newspaper"),
|
||||||
(PHOTO, _("Photo"), "Photo"),
|
(PHOTO, _("Photo"), "Photo"),
|
||||||
(TOMBSTONE, _("Tombstone"), "Tombstone"),
|
(TOMBSTONE, _("Tombstone"), "Tombstone"),
|
||||||
(VIDEO, _("Video"), "Video"),
|
(VIDEO, _("Video"), "Video"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, value=None):
|
def __init__(self, value=None):
|
||||||
|
@ -18,15 +18,9 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
"Define text formatting tag types."
|
"""
|
||||||
|
Define text formatting tag types.
|
||||||
#------------------------------------------------------------------------
|
"""
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -34,6 +28,8 @@ _ = glocale.translation.gettext
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -41,10 +37,11 @@ from .grampstype import GrampsType
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class StyledTextTagType(GrampsType):
|
class StyledTextTagType(GrampsType):
|
||||||
"""Text formatting tag type definition.
|
"""
|
||||||
|
Text formatting tag type definition.
|
||||||
Here we only define new class variables. For details see :class:`~gen.lib.grampstype.GrampsType`.
|
|
||||||
|
|
||||||
|
Here we only define new class variables. For details see
|
||||||
|
:class:`~gen.lib.grampstype.GrampsType`.
|
||||||
"""
|
"""
|
||||||
NONE_TYPE = -1
|
NONE_TYPE = -1
|
||||||
BOLD = 0
|
BOLD = 0
|
||||||
|
@ -22,44 +22,35 @@
|
|||||||
URL types
|
URL types
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Python modules
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
|
||||||
_ = glocale.translation.gettext
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from .grampstype import GrampsType
|
from .grampstype import GrampsType
|
||||||
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
class UrlType(GrampsType):
|
class UrlType(GrampsType):
|
||||||
|
|
||||||
UNKNOWN = -1
|
UNKNOWN = -1
|
||||||
CUSTOM = 0
|
CUSTOM = 0
|
||||||
EMAIL = 1
|
EMAIL = 1
|
||||||
WEB_HOME = 2
|
WEB_HOME = 2
|
||||||
WEB_SEARCH = 3
|
WEB_SEARCH = 3
|
||||||
WEB_FTP = 4
|
WEB_FTP = 4
|
||||||
|
|
||||||
_CUSTOM = CUSTOM
|
_CUSTOM = CUSTOM
|
||||||
_DEFAULT = UNKNOWN
|
_DEFAULT = UNKNOWN
|
||||||
|
|
||||||
_DATAMAP = [
|
_DATAMAP = [
|
||||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||||
(CUSTOM, _("Custom"), "Custom"),
|
(CUSTOM, _("Custom"), "Custom"),
|
||||||
(EMAIL, _("E-mail"), "E-mail"),
|
(EMAIL, _("E-mail"), "E-mail"),
|
||||||
(WEB_HOME, _("Web Home"), "Web Home"),
|
(WEB_HOME, _("Web Home"), "Web Home"),
|
||||||
(WEB_SEARCH, _("Web Search"), "Web Search"),
|
(WEB_SEARCH, _("Web Search"), "Web Search"),
|
||||||
(WEB_FTP, _("FTP"), "FTP"),
|
(WEB_FTP, _("FTP"), "FTP"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, value=None):
|
def __init__(self, value=None):
|
||||||
GrampsType.__init__(self, value)
|
GrampsType.__init__(self, value)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user