Gramps type pylint improvements
This commit is contained in:
parent
1654757c22
commit
80f05956b4
@ -23,19 +23,14 @@
|
||||
Provide the different Attribute Types for Gramps.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class AttributeType(GrampsType):
|
||||
|
||||
@ -64,23 +59,22 @@ class AttributeType(GrampsType):
|
||||
return value
|
||||
|
||||
_BASEMAP = [ # allow deferred translation of attribute UI strings
|
||||
(UNKNOWN , _T_("Unknown"), "Unknown"),
|
||||
(CUSTOM , _T_("Custom"), "Custom"),
|
||||
(CASTE , _T_("Caste"), "Caste"),
|
||||
(DESCRIPTION , _T_("Description"), "Description"),
|
||||
(ID , _T_("Identification Number"), "Identification Number"),
|
||||
(NATIONAL , _T_("National Origin"), "National Origin"),
|
||||
(NUM_CHILD , _T_("Number of Children"), "Number of Children"),
|
||||
(SSN , _T_("Social Security Number"),
|
||||
"Social Security Number"),
|
||||
(NICKNAME , _T_("Nickname"), "Nickname"),
|
||||
(CAUSE , _T_("Cause"), "Cause"),
|
||||
(AGENCY , _T_("Agency"), "Agency"),
|
||||
(AGE , _T_("Age"), "Age"),
|
||||
(FATHER_AGE , _T_("Father's Age"), "Father Age"),
|
||||
(MOTHER_AGE , _T_("Mother's Age"), "Mother Age"),
|
||||
(WITNESS , _T_("Witness"), "Witness"),
|
||||
(TIME , _T_("Time"), "Time"),
|
||||
(UNKNOWN, _T_("Unknown"), "Unknown"),
|
||||
(CUSTOM, _T_("Custom"), "Custom"),
|
||||
(CASTE, _T_("Caste"), "Caste"),
|
||||
(DESCRIPTION, _T_("Description"), "Description"),
|
||||
(ID, _T_("Identification Number"), "Identification Number"),
|
||||
(NATIONAL, _T_("National Origin"), "National Origin"),
|
||||
(NUM_CHILD, _T_("Number of Children"), "Number of Children"),
|
||||
(SSN, _T_("Social Security Number"), "Social Security Number"),
|
||||
(NICKNAME, _T_("Nickname"), "Nickname"),
|
||||
(CAUSE, _T_("Cause"), "Cause"),
|
||||
(AGENCY, _T_("Agency"), "Agency"),
|
||||
(AGE, _T_("Age"), "Age"),
|
||||
(FATHER_AGE, _T_("Father's Age"), "Father Age"),
|
||||
(MOTHER_AGE, _T_("Mother's Age"), "Mother Age"),
|
||||
(WITNESS, _T_("Witness"), "Witness"),
|
||||
(TIME, _T_("Time"), "Time"),
|
||||
]
|
||||
|
||||
_DATAMAP = [(base[0], _(base[1]), base[2]) for base in _BASEMAP]
|
||||
|
@ -21,13 +21,6 @@
|
||||
"""
|
||||
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 ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class ChildRefType(GrampsType):
|
||||
"""
|
||||
@ -81,6 +76,3 @@ class ChildRefType(GrampsType):
|
||||
|
||||
def __init__(self, value=None):
|
||||
GrampsType.__init__(self, value)
|
||||
|
||||
|
||||
|
||||
|
@ -22,20 +22,14 @@
|
||||
Provide the different event roles.
|
||||
"""
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.sgettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.sgettext
|
||||
|
||||
class EventRoleType(GrampsType):
|
||||
|
||||
@ -82,4 +76,3 @@ class EventRoleType(GrampsType):
|
||||
Returns True if EventRoleType is FAMILY, False otherwise.
|
||||
"""
|
||||
return self.value == self.FAMILY
|
||||
|
||||
|
@ -23,20 +23,14 @@
|
||||
Provide the different event types
|
||||
"""
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.sgettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.sgettext
|
||||
|
||||
class EventType(GrampsType):
|
||||
"""
|
||||
@ -165,52 +159,52 @@ class EventType(GrampsType):
|
||||
_DEFAULT = BIRTH
|
||||
|
||||
_DATAMAP = [
|
||||
(UNKNOWN , _("Unknown"), "Unknown"),
|
||||
(CUSTOM , _("Custom"), "Custom"),
|
||||
(ADOPT , _("Adopted"), "Adopted"),
|
||||
(BIRTH , _("Birth"), "Birth"),
|
||||
(DEATH , _("Death"), "Death"),
|
||||
(ADULT_CHRISTEN , _("Adult Christening"), "Adult Christening"),
|
||||
(BAPTISM , _("Baptism"), "Baptism"),
|
||||
(BAR_MITZVAH , _("Bar Mitzvah"), "Bar Mitzvah"),
|
||||
(BAS_MITZVAH , _("Bat Mitzvah"), "Bas Mitzvah"),
|
||||
(BLESS , _("Blessing"), "Blessing"),
|
||||
(BURIAL , _("Burial"), "Burial"),
|
||||
(CAUSE_DEATH , _("Cause Of Death"), "Cause Of Death"),
|
||||
(CENSUS , _("Census"), "Census"),
|
||||
(CHRISTEN , _("Christening"), "Christening"),
|
||||
(CONFIRMATION , _("Confirmation"), "Confirmation"),
|
||||
(CREMATION , _("Cremation"), "Cremation"),
|
||||
(DEGREE , _("Degree"), "Degree"),
|
||||
(EDUCATION , _("Education"), "Education"),
|
||||
(ELECTED , _("Elected"), "Elected"),
|
||||
(EMIGRATION , _("Emigration"), "Emigration"),
|
||||
(FIRST_COMMUN , _("First Communion"), "First Communion"),
|
||||
(IMMIGRATION , _("Immigration"), "Immigration"),
|
||||
(GRADUATION , _("Graduation"), "Graduation"),
|
||||
(MED_INFO , _("Medical Information"), "Medical Information"),
|
||||
(MILITARY_SERV , _("Military Service"), "Military Service"),
|
||||
(NATURALIZATION , _("Naturalization"), "Naturalization"),
|
||||
(NOB_TITLE , _("Nobility Title"), "Nobility Title"),
|
||||
(NUM_MARRIAGES , _("Number of Marriages"), "Number of Marriages"),
|
||||
(OCCUPATION , _("Occupation"), "Occupation"),
|
||||
(ORDINATION , _("Ordination"), "Ordination"),
|
||||
(PROBATE , _("Probate"), "Probate"),
|
||||
(PROPERTY , _("Property"), "Property"),
|
||||
(RELIGION , _("Religion"), "Religion"),
|
||||
(RESIDENCE , _("Residence"), "Residence"),
|
||||
(RETIREMENT , _("Retirement"), "Retirement"),
|
||||
(WILL , _("Will"), "Will"),
|
||||
(MARRIAGE , _("Marriage"), "Marriage"),
|
||||
(MARR_SETTL , _("Marriage Settlement"), "Marriage Settlement"),
|
||||
(MARR_LIC , _("Marriage License"), "Marriage License"),
|
||||
(MARR_CONTR , _("Marriage Contract"), "Marriage Contract"),
|
||||
(MARR_BANNS , _("Marriage Banns"), "Marriage Banns"),
|
||||
(ENGAGEMENT , _("Engagement"), "Engagement"),
|
||||
(DIVORCE , _("Divorce"), "Divorce"),
|
||||
(DIV_FILING , _("Divorce Filing"), "Divorce Filing"),
|
||||
(ANNULMENT , _("Annulment"), "Annulment"),
|
||||
(MARR_ALT , _("Alternate Marriage"), "Alternate Marriage"),
|
||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||
(CUSTOM, _("Custom"), "Custom"),
|
||||
(ADOPT, _("Adopted"), "Adopted"),
|
||||
(BIRTH, _("Birth"), "Birth"),
|
||||
(DEATH, _("Death"), "Death"),
|
||||
(ADULT_CHRISTEN, _("Adult Christening"), "Adult Christening"),
|
||||
(BAPTISM, _("Baptism"), "Baptism"),
|
||||
(BAR_MITZVAH, _("Bar Mitzvah"), "Bar Mitzvah"),
|
||||
(BAS_MITZVAH, _("Bat Mitzvah"), "Bas Mitzvah"),
|
||||
(BLESS, _("Blessing"), "Blessing"),
|
||||
(BURIAL, _("Burial"), "Burial"),
|
||||
(CAUSE_DEATH, _("Cause Of Death"), "Cause Of Death"),
|
||||
(CENSUS, _("Census"), "Census"),
|
||||
(CHRISTEN, _("Christening"), "Christening"),
|
||||
(CONFIRMATION, _("Confirmation"), "Confirmation"),
|
||||
(CREMATION, _("Cremation"), "Cremation"),
|
||||
(DEGREE, _("Degree"), "Degree"),
|
||||
(EDUCATION, _("Education"), "Education"),
|
||||
(ELECTED, _("Elected"), "Elected"),
|
||||
(EMIGRATION, _("Emigration"), "Emigration"),
|
||||
(FIRST_COMMUN, _("First Communion"), "First Communion"),
|
||||
(IMMIGRATION, _("Immigration"), "Immigration"),
|
||||
(GRADUATION, _("Graduation"), "Graduation"),
|
||||
(MED_INFO, _("Medical Information"), "Medical Information"),
|
||||
(MILITARY_SERV, _("Military Service"), "Military Service"),
|
||||
(NATURALIZATION, _("Naturalization"), "Naturalization"),
|
||||
(NOB_TITLE, _("Nobility Title"), "Nobility Title"),
|
||||
(NUM_MARRIAGES, _("Number of Marriages"), "Number of Marriages"),
|
||||
(OCCUPATION, _("Occupation"), "Occupation"),
|
||||
(ORDINATION, _("Ordination"), "Ordination"),
|
||||
(PROBATE, _("Probate"), "Probate"),
|
||||
(PROPERTY, _("Property"), "Property"),
|
||||
(RELIGION, _("Religion"), "Religion"),
|
||||
(RESIDENCE, _("Residence"), "Residence"),
|
||||
(RETIREMENT, _("Retirement"), "Retirement"),
|
||||
(WILL, _("Will"), "Will"),
|
||||
(MARRIAGE, _("Marriage"), "Marriage"),
|
||||
(MARR_SETTL, _("Marriage Settlement"), "Marriage Settlement"),
|
||||
(MARR_LIC, _("Marriage License"), "Marriage License"),
|
||||
(MARR_CONTR, _("Marriage Contract"), "Marriage Contract"),
|
||||
(MARR_BANNS, _("Marriage Banns"), "Marriage Banns"),
|
||||
(ENGAGEMENT, _("Engagement"), "Engagement"),
|
||||
(DIVORCE, _("Divorce"), "Divorce"),
|
||||
(DIV_FILING, _("Divorce Filing"), "Divorce Filing"),
|
||||
(ANNULMENT, _("Annulment"), "Annulment"),
|
||||
(MARR_ALT, _("Alternate Marriage"), "Alternate Marriage"),
|
||||
]
|
||||
|
||||
_ABBREVIATIONS = {
|
||||
@ -367,6 +361,7 @@ class EventType(GrampsType):
|
||||
else:
|
||||
abbrev = str(self)
|
||||
if " " in abbrev:
|
||||
return ".".join([letter[0].lower() for letter in abbrev.split()]) + "."
|
||||
return ".".join([letter[0].lower()
|
||||
for letter in abbrev.split()]) + "."
|
||||
else:
|
||||
return abbrev[:3].lower() + "."
|
||||
|
@ -21,13 +21,6 @@
|
||||
"""
|
||||
Provide the different family reference types.
|
||||
"""
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -36,6 +29,8 @@ _ = glocale.translation.gettext
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..config import config
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class FamilyRelType(GrampsType):
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
"""
|
||||
Base type for all gramps types.
|
||||
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -54,7 +53,7 @@ class GrampsTypeMeta(type):
|
||||
"""
|
||||
if blacklist:
|
||||
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:
|
||||
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)
|
||||
|
||||
|
||||
# Python 2 and 3 metaclass children classes
|
||||
GrampsTypeC = GrampsTypeMeta(str('GrampsTypeC'), (object, ), {})
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# GrampsType class
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
## python 3: class GrampsType(object, metaclass=GrampsTypeMeta):
|
||||
class GrampsType(GrampsTypeC):
|
||||
class GrampsType(object, metaclass=GrampsTypeMeta):
|
||||
"""Base class for all Gramps object types.
|
||||
|
||||
:cvar _DATAMAP:
|
||||
@ -108,7 +103,11 @@ class GrampsType(GrampsTypeC):
|
||||
|
||||
_DATAMAP = []
|
||||
_BLACKLIST = None
|
||||
_MENU = None
|
||||
_I2SMAP = {}
|
||||
_S2IMAP = {}
|
||||
_I2EMAP = {}
|
||||
_E2IMAP = {}
|
||||
_MENU = []
|
||||
__slots__ = ('__value', '__string')
|
||||
|
||||
def __getstate__(self):
|
||||
@ -126,6 +125,9 @@ class GrampsType(GrampsTypeC):
|
||||
Create a new type, initialize the value from one of several possible
|
||||
states.
|
||||
"""
|
||||
self.__value = self._DEFAULT
|
||||
self.__string = ''
|
||||
if value is not None:
|
||||
self.set(value)
|
||||
|
||||
def __set_tuple(self, value):
|
||||
@ -238,7 +240,8 @@ class GrampsType(GrampsTypeC):
|
||||
"""
|
||||
default = cls()
|
||||
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:
|
||||
return (struct.get("value", default.value), '')
|
||||
|
||||
@ -283,7 +286,7 @@ class GrampsType(GrampsTypeC):
|
||||
def get_menu(self):
|
||||
"""Return the list of localized names for the 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
|
||||
|
||||
def get_menu_standard_xml(self):
|
||||
@ -312,28 +315,5 @@ class GrampsType(GrampsTypeC):
|
||||
def __ne__(self, 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")
|
||||
string = property(__str__, __set_str, None, "Returns or sets string value")
|
||||
|
@ -25,20 +25,14 @@ From version 3.3 onwards, this is only kept to convert markers into tags
|
||||
when loading old database files.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class MarkerType(GrampsType):
|
||||
"""
|
||||
@ -62,4 +56,3 @@ class MarkerType(GrampsType):
|
||||
|
||||
def __init__(self, value=None):
|
||||
GrampsType.__init__(self, value)
|
||||
|
||||
|
@ -22,20 +22,14 @@
|
||||
Name types.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.sgettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.sgettext
|
||||
|
||||
class NameOriginType(GrampsType):
|
||||
"""
|
||||
@ -67,8 +61,8 @@ class NameOriginType(GrampsType):
|
||||
MATRONYMIC = 6
|
||||
FEUDAL = 7
|
||||
PSEUDONYM = 8
|
||||
PATRILINEAL= 9
|
||||
MATRILINEAL= 10
|
||||
PATRILINEAL = 9
|
||||
MATRILINEAL = 10
|
||||
OCCUPATION = 11
|
||||
LOCATION = 12
|
||||
|
||||
@ -76,22 +70,21 @@ class NameOriginType(GrampsType):
|
||||
_DEFAULT = NONE
|
||||
|
||||
_DATAMAP = [
|
||||
(UNKNOWN , _("Unknown"), "Unknown"),
|
||||
(CUSTOM , _("Custom"), "Custom"),
|
||||
(NONE , "", ""),
|
||||
(INHERITED , _("Surname|Inherited"), "Inherited"),
|
||||
(GIVEN , _("Surname|Given"), "Given"),
|
||||
(TAKEN , _("Surname|Taken"), "Taken"),
|
||||
(PATRONYMIC , _("Patronymic"), "Patronymic"),
|
||||
(MATRONYMIC , _("Matronymic"), "Matronymic"),
|
||||
(FEUDAL , _("Surname|Feudal"), "Feudal"),
|
||||
(PSEUDONYM , _("Pseudonym"), "Pseudonym"),
|
||||
(UNKNOWN, _("Unknown"), "Unknown "),
|
||||
(CUSTOM, _("Custom"), "Custom"),
|
||||
(NONE, "", ""),
|
||||
(INHERITED, _("Surname|Inherited"), "Inherited"),
|
||||
(GIVEN, _("Surname|Given"), "Given"),
|
||||
(TAKEN, _("Surname|Taken"), "Taken"),
|
||||
(PATRONYMIC, _("Patronymic"), "Patronymic"),
|
||||
(MATRONYMIC, _("Matronymic"), "Matronymic"),
|
||||
(FEUDAL, _("Surname|Feudal"), "Feudal"),
|
||||
(PSEUDONYM, _("Pseudonym"), "Pseudonym"),
|
||||
(PATRILINEAL, _("Patrilineal"), "Patrilineal"),
|
||||
(MATRILINEAL, _("Matrilineal"), "Matrilineal"),
|
||||
(OCCUPATION , _("Occupation"), "Occupation"),
|
||||
(LOCATION , _("Location"), "Location"),
|
||||
(OCCUPATION, _("Occupation"), "Occupation"),
|
||||
(LOCATION, _("Location"), "Location"),
|
||||
]
|
||||
|
||||
def __init__(self, value=None):
|
||||
GrampsType.__init__(self, value)
|
||||
|
||||
|
@ -22,20 +22,14 @@
|
||||
Name types.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class NameType(GrampsType):
|
||||
|
||||
@ -58,4 +52,3 @@ class NameType(GrampsType):
|
||||
|
||||
def __init__(self, value=None):
|
||||
GrampsType.__init__(self, value)
|
||||
|
||||
|
@ -27,16 +27,10 @@ Note types.
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.sgettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
|
||||
class NoteType(GrampsType):
|
||||
|
||||
UNKNOWN = -1
|
||||
@ -73,7 +67,6 @@ class NoteType(GrampsType):
|
||||
_CUSTOM = CUSTOM
|
||||
_DEFAULT = GENERAL
|
||||
|
||||
|
||||
_DATAMAPREAL = [
|
||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||
(CUSTOM, _("Custom"), "Custom"),
|
||||
@ -88,21 +81,20 @@ class NoteType(GrampsType):
|
||||
]
|
||||
|
||||
_DATAMAPIGNORE = [
|
||||
(PERSON, _("Person Note"),"Person Note"),
|
||||
(PERSON, _("Person Note"), "Person Note"),
|
||||
(PERSONNAME, _("Name Note"), "Name Note"),
|
||||
(ATTRIBUTE, _("Attribute Note"), "Attribute Note"),
|
||||
(ADDRESS, _("Address Note"), "Address Note"),
|
||||
(ASSOCIATION,_("Association Note"), "Association Note"),
|
||||
(ASSOCIATION, _("Association Note"), "Association Note"),
|
||||
(LDS, _("LDS Note"), "LDS Note"),
|
||||
(FAMILY, _("Family Note"),"Family Note"),
|
||||
(FAMILY, _("Family Note"), "Family Note"),
|
||||
(EVENT, _("Event Note"), "Event Note"),
|
||||
(EVENTREF, _("Event Reference Note"), "Event Reference Note"),
|
||||
(SOURCE, _("Source Note"), "Source Note"),
|
||||
(SOURCEREF, _("Source Reference Note"), "Source Reference Note"),
|
||||
(PLACE, _("Place Note"), "Place Note"),
|
||||
(REPO, _("Repository Note"), "Repository Note"),
|
||||
(REPOREF, _("Repository Reference Note"),
|
||||
"Repository Reference Note"),
|
||||
(REPOREF, _("Repository Reference Note"), "Repository Reference Note"),
|
||||
(MEDIA, _("Media Note"), "Media Note"),
|
||||
(MEDIAREF, _("Media Reference Note"), "Media Reference Note"),
|
||||
(CHILDREF, _("Child Reference Note"), "Child Reference Note"),
|
||||
|
@ -21,13 +21,6 @@
|
||||
"""
|
||||
Provide the different place types.
|
||||
"""
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -35,6 +28,8 @@ _ = glocale.translation.gettext
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class PlaceType(GrampsType):
|
||||
|
||||
|
@ -22,20 +22,14 @@
|
||||
Repository types.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class RepositoryType(GrampsType):
|
||||
|
||||
@ -70,4 +64,3 @@ class RepositoryType(GrampsType):
|
||||
|
||||
def __init__(self, value=None):
|
||||
GrampsType.__init__(self, value)
|
||||
|
||||
|
@ -22,20 +22,14 @@
|
||||
Provide the different Source Attribute Types for Gramps.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Standard Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class SrcAttributeType(GrampsType):
|
||||
|
||||
@ -46,8 +40,8 @@ class SrcAttributeType(GrampsType):
|
||||
_DEFAULT = UNKNOWN
|
||||
|
||||
_DATAMAP = [
|
||||
(UNKNOWN , _("Unknown"), "Unknown"),
|
||||
(CUSTOM , _("Custom"), "Custom"),
|
||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||
(CUSTOM, _("Custom"), "Custom"),
|
||||
]
|
||||
|
||||
def __init__(self, value=None):
|
||||
|
@ -22,20 +22,14 @@
|
||||
SourceMedia types.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class SourceMediaType(GrampsType):
|
||||
|
||||
|
@ -18,15 +18,9 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
"Define text formatting tag types."
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
"""
|
||||
Define text formatting tag types.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -34,6 +28,8 @@ _ = glocale.translation.gettext
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
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):
|
||||
"""Text formatting tag type definition.
|
||||
|
||||
Here we only define new class variables. For details see :class:`~gen.lib.grampstype.GrampsType`.
|
||||
"""
|
||||
Text formatting tag type definition.
|
||||
|
||||
Here we only define new class variables. For details see
|
||||
:class:`~gen.lib.grampstype.GrampsType`.
|
||||
"""
|
||||
NONE_TYPE = -1
|
||||
BOLD = 0
|
||||
|
@ -22,20 +22,14 @@
|
||||
URL types
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from .grampstype import GrampsType
|
||||
from ..const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class UrlType(GrampsType):
|
||||
|
||||
@ -60,6 +54,3 @@ class UrlType(GrampsType):
|
||||
|
||||
def __init__(self, value=None):
|
||||
GrampsType.__init__(self, value)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user