Convert some imports from absolute to relative

This commit is contained in:
Nick Hall 2017-02-20 18:15:25 +00:00
parent e46321a7c6
commit 3e5a956454
42 changed files with 108 additions and 124 deletions

View File

@ -41,9 +41,9 @@ import uuid
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from .git_revision import get_git_revision from .git_revision import get_git_revision
from .constfunc import get_env_var from .constfunc import get_env_var
from gramps.version import VERSION, VERSION_TUPLE, major_version from ..version import VERSION, VERSION_TUPLE, major_version
from gramps.gen.utils.resourcepath import ResourcePath from .utils.resourcepath import ResourcePath
from gramps.gen.utils.grampslocale import GrampsLocale from .utils.grampslocale import GrampsLocale
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -46,7 +46,7 @@ from ._dateparser import DateParser
from ._datedisplay import DateDisplay, DateDisplayEn from ._datedisplay import DateDisplay, DateDisplayEn
from ..constfunc import win from ..constfunc import win
from ..const import GRAMPS_LOCALE as glocale from ..const import GRAMPS_LOCALE as glocale
from gramps.gen.utils.grampslocale import GrampsLocale from ..utils.grampslocale import GrampsLocale
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -251,7 +251,7 @@ class DateStrings:
if __name__ == '__main__': if __name__ == '__main__':
import sys import sys
from ..utils.grampslocale import GrampsLocale from ..utils.grampslocale import GrampsLocale
from gramps.gen.const import GRAMPS_LOCALE as glocale from ..const import GRAMPS_LOCALE as glocale
from ._grampslocale import (_deprecated_long_months as old_long, from ._grampslocale import (_deprecated_long_months as old_long,
_deprecated_short_months as old_short, _deprecated_short_months as old_short,
_deprecated_long_days as old_days) _deprecated_long_days as old_days)

View File

@ -21,7 +21,7 @@
# #
import locale import locale
from gramps.gen.const import GRAMPS_LOCALE as glocale from ..const import GRAMPS_LOCALE as glocale
""" """
Some OS environments do not support the locale.nl_langinfo() method Some OS environments do not support the locale.nl_langinfo() method

View File

@ -63,10 +63,10 @@ from functools import wraps
# Gramps libraries # Gramps libraries
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.gen.db.base import DbReadBase from .base import DbReadBase
from gramps.gen.db.dbconst import DBLOGNAME from .dbconst import DBLOGNAME
from gramps.gen.errors import HandleError from ..errors import HandleError
from gramps.gen.utils.callback import Callback from ..utils.callback import Callback
LOG = logging.getLogger(DBLOGNAME) LOG = logging.getLogger(DBLOGNAME)

View File

@ -25,8 +25,8 @@
# Gramps modules # Gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.gen.const import URL_WIKISTRING, URL_MANUAL_PAGE from ..const import URL_WIKISTRING, URL_MANUAL_PAGE
from gramps.gen.const import GRAMPS_LOCALE as glocale from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -41,24 +41,23 @@ import glob
# Gramps Modules # Gramps Modules
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from gramps.gen.db import (DbReadBase, DbWriteBase, DbUndo, DBLOGNAME, from . import (DbReadBase, DbWriteBase, DbUndo, DBLOGNAME, DBUNDOFN,
DBUNDOFN, KEY_TO_CLASS_MAP, REFERENCE_KEY, KEY_TO_CLASS_MAP, REFERENCE_KEY, PERSON_KEY, FAMILY_KEY,
PERSON_KEY, FAMILY_KEY, CITATION_KEY, CITATION_KEY, SOURCE_KEY, EVENT_KEY, MEDIA_KEY, PLACE_KEY,
SOURCE_KEY, EVENT_KEY, MEDIA_KEY, REPOSITORY_KEY, NOTE_KEY, TAG_KEY)
PLACE_KEY, REPOSITORY_KEY, NOTE_KEY, TAG_KEY) from ..errors import HandleError
from gramps.gen.errors import HandleError from ..utils.callback import Callback
from gramps.gen.utils.callback import Callback from ..updatecallback import UpdateCallback
from gramps.gen.updatecallback import UpdateCallback from .bookmarks import DbBookmarks
from gramps.gen.db.bookmarks import DbBookmarks from . import exceptions
from gramps.gen.db import exceptions
from gramps.gen.utils.id import create_id from ..utils.id import create_id
from gramps.gen.lib.researcher import Researcher from ..lib.researcher import Researcher
from gramps.gen.lib import (Tag, Media, Person, Family, Source, Citation, Event, from ..lib import (Tag, Media, Person, Family, Source, Citation, Event,
Place, Repository, Note, NameOriginType) Place, Repository, Note, NameOriginType)
from gramps.gen.lib.genderstats import GenderStats from ..lib.genderstats import GenderStats
from gramps.gen.config import config from ..config import config
from gramps.gen.const import GRAMPS_LOCALE as glocale from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
LOG = logging.getLogger(DBLOGNAME) LOG = logging.getLogger(DBLOGNAME)

View File

@ -172,7 +172,7 @@ def __index_surname(surn_list):
pa/matronymic not as they change for every generation! pa/matronymic not as they change for every generation!
returns a byte string returns a byte string
""" """
from gramps.gen.lib import NameOriginType from ..lib import NameOriginType
if surn_list: if surn_list:
surn = " ".join([x[0] for x in surn_list if not (x[3][0] in [ surn = " ".join([x[0] for x in surn_list if not (x[3][0] in [
NameOriginType.PATRONYMIC, NameOriginType.MATRONYMIC])]) NameOriginType.PATRONYMIC, NameOriginType.MATRONYMIC])])

View File

@ -42,8 +42,8 @@ from .db import DbReadBase
from .proxy.proxybase import ProxyDbBase from .proxy.proxybase import ProxyDbBase
from .utils.callback import Callback from .utils.callback import Callback
from .config import config from .config import config
from gramps.gen.db.dbconst import DBLOGNAME from .db.dbconst import DBLOGNAME
from gramps.gen.db.dummydb import DummyDb from .db.dummydb import DummyDb
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -22,8 +22,6 @@
Package providing filtering framework for GRAMPS. Package providing filtering framework for GRAMPS.
""" """
from gramps.gen.constfunc import win
class SearchFilter: class SearchFilter:
def __init__(self, func, text, invert): def __init__(self, func, text, invert):
self.func = func self.func = func

View File

@ -33,10 +33,10 @@ import time
# Gramps modules # Gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from . import Rule
from ...errors import FilterError
from ...const import GRAMPS_LOCALE as glocale from ...const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
from . import Rule
from gramps.gen.errors import FilterError
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -24,9 +24,9 @@
# Gramps modules # Gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from . import Rule from . import Rule
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# "People marked public" # "People marked public"

View File

@ -33,10 +33,10 @@ LOG = logging.getLogger(".filter")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# we need global variableCustomFilters, so we need to query gramps.gen.filters # we need global variableCustomFilters, so we need to query gramps.gen.filters
# when we need this variable, not import it at the start! # when we need this variable, not import it at the start!
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
import gramps.gen.filters import gramps.gen.filters
from . import Rule from . import Rule
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -18,20 +18,14 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# #
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Gramps modules # Gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from .. import Rule from .. import Rule
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -30,9 +30,9 @@
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from .. import Rule from .. import Rule
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from ....lib.childreftype import ChildRefType from ....lib.childreftype import ChildRefType
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -31,7 +31,7 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from ....lib.notetype import NoteType from ....lib.notetype import NoteType
from .. import Rule from .. import Rule
from gramps.gen.const import GRAMPS_LOCALE as glocale from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -18,14 +18,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# #
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Gramps modules # Gramps modules
@ -33,7 +25,9 @@ _ = glocale.translation.sgettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from .. import Rule from .. import Rule
from ....lib.nameorigintype import NameOriginType from ....lib.nameorigintype import NameOriginType
from gramps.gen.soundex import soundex from ....soundex import soundex
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -24,12 +24,12 @@ Unittest that tests event-specific filter rules
import unittest import unittest
import os import os
from gramps.gen.db.utils import import_as_dict from ....db.utils import import_as_dict
from ....filters import GenericFilterFactory
from ....const import DATA_DIR
from gramps.cli.user import User from gramps.cli.user import User
from gramps.gen.filters import GenericFilterFactory
from gramps.gen.const import DATA_DIR
from gramps.gen.filters.rules.event import ( from ..event import (
AllEvents, HasType, HasIdOf, HasGallery, RegExpIdOf, HasCitation, HasNote, AllEvents, HasType, HasIdOf, HasGallery, RegExpIdOf, HasCitation, HasNote,
HasNoteRegexp, HasReferenceCountOf, HasSourceCount, EventPrivate, HasNoteRegexp, HasReferenceCountOf, HasSourceCount, EventPrivate,
MatchesSourceConfidence, HasAttribute, HasData, ChangedSince, HasTag, MatchesSourceConfidence, HasAttribute, HasData, ChangedSince, HasTag,

View File

@ -24,12 +24,12 @@ Unittest that tests family-specific filter rules
import unittest import unittest
import os import os
from gramps.gen.db.utils import import_as_dict from ....db.utils import import_as_dict
from ....filters import GenericFilterFactory
from ....const import DATA_DIR
from gramps.cli.user import User from gramps.cli.user import User
from gramps.gen.filters import GenericFilterFactory
from gramps.gen.const import DATA_DIR
from gramps.gen.filters.rules.family import ( from ..family import (
AllFamilies, HasRelType, HasGallery, HasIdOf, HasLDS, HasNote, RegExpIdOf, AllFamilies, HasRelType, HasGallery, HasIdOf, HasLDS, HasNote, RegExpIdOf,
HasNoteRegexp, HasReferenceCountOf, HasSourceCount, HasSourceOf, HasNoteRegexp, HasReferenceCountOf, HasSourceCount, HasSourceOf,
HasCitation, FamilyPrivate, HasEvent, HasAttribute, IsBookmarked, HasCitation, FamilyPrivate, HasEvent, HasAttribute, IsBookmarked,

View File

@ -24,12 +24,12 @@ Unittest that tests media-specific filter rules
import unittest import unittest
import os import os
from gramps.gen.db.utils import import_as_dict from ....db.utils import import_as_dict
from ....filters import GenericFilterFactory
from ....const import DATA_DIR
from gramps.cli.user import User from gramps.cli.user import User
from gramps.gen.filters import GenericFilterFactory
from gramps.gen.const import DATA_DIR
from gramps.gen.filters.rules.media import ( from ..media import (
AllMedia, HasIdOf, RegExpIdOf, HasCitation, HasNoteRegexp, AllMedia, HasIdOf, RegExpIdOf, HasCitation, HasNoteRegexp,
HasNoteMatchingSubstringOf, HasReferenceCountOf, HasSourceCount, HasNoteMatchingSubstringOf, HasReferenceCountOf, HasSourceCount,
HasSourceOf, MediaPrivate, MatchesSourceConfidence, HasMedia, HasSourceOf, MediaPrivate, MatchesSourceConfidence, HasMedia,

View File

@ -24,12 +24,12 @@ Unittest that tests note-specific filter rules
import unittest import unittest
import os import os
from gramps.gen.db.utils import import_as_dict from ....db.utils import import_as_dict
from ....filters import GenericFilterFactory
from ....const import DATA_DIR
from gramps.cli.user import User from gramps.cli.user import User
from gramps.gen.filters import GenericFilterFactory
from gramps.gen.const import DATA_DIR
from gramps.gen.filters.rules.note import ( from ..note import (
AllNotes, HasIdOf, RegExpIdOf, HasNote, MatchesRegexpOf, AllNotes, HasIdOf, RegExpIdOf, HasNote, MatchesRegexpOf,
HasReferenceCountOf, NotePrivate, ChangedSince, HasTag, HasType) HasReferenceCountOf, NotePrivate, ChangedSince, HasTag, HasType)

View File

@ -24,12 +24,12 @@ Unittest that tests person-specific filter rules
import unittest import unittest
import os import os
from gramps.gen.db.utils import import_as_dict from ....db.utils import import_as_dict
from ....filters import GenericFilter
from ....const import DATA_DIR
from gramps.cli.user import User from gramps.cli.user import User
from gramps.gen.filters import GenericFilter
from gramps.gen.const import DATA_DIR
from gramps.gen.filters.rules.person import ( from ..person import (
Disconnected, Everyone, FamilyWithIncompleteEvent, HasAlternateName, Disconnected, Everyone, FamilyWithIncompleteEvent, HasAlternateName,
HasCommonAncestorWith, HasNickname, HasUnknownGender, HasSourceOf, HasCommonAncestorWith, HasNickname, HasUnknownGender, HasSourceOf,
HaveAltFamilies, HaveChildren, IncompleteNames, IsBookmarked, HaveAltFamilies, HaveChildren, IncompleteNames, IsBookmarked,

View File

@ -24,12 +24,12 @@ Unittest that tests place-specific filter rules
import unittest import unittest
import os import os
from gramps.gen.db.utils import import_as_dict from ....db.utils import import_as_dict
from ....filters import GenericFilterFactory
from ....const import DATA_DIR
from gramps.cli.user import User from gramps.cli.user import User
from gramps.gen.filters import GenericFilterFactory
from gramps.gen.const import DATA_DIR
from gramps.gen.filters.rules.place import ( from ..place import (
AllPlaces, HasCitation, HasGallery, HasIdOf, RegExpIdOf, HasNote, AllPlaces, HasCitation, HasGallery, HasIdOf, RegExpIdOf, HasNote,
HasNoteRegexp, HasReferenceCountOf, HasSourceCount, HasSourceOf, HasNoteRegexp, HasReferenceCountOf, HasSourceCount, HasSourceOf,
PlacePrivate, MatchesSourceConfidence, HasData, HasNoLatOrLon, PlacePrivate, MatchesSourceConfidence, HasData, HasNoLatOrLon,

View File

@ -24,12 +24,12 @@ Unittest that tests repository-specific filter rules
import unittest import unittest
import os import os
from gramps.gen.db.utils import import_as_dict from ....db.utils import import_as_dict
from ....filters import GenericFilterFactory
from ....const import DATA_DIR
from gramps.cli.user import User from gramps.cli.user import User
from gramps.gen.filters import GenericFilterFactory
from gramps.gen.const import DATA_DIR
from gramps.gen.filters.rules.repository import ( from ..repository import (
AllRepos, HasIdOf, RegExpIdOf, HasNoteRegexp, HasReferenceCountOf, AllRepos, HasIdOf, RegExpIdOf, HasNoteRegexp, HasReferenceCountOf,
RepoPrivate, ChangedSince, MatchesNameSubstringOf, HasTag) RepoPrivate, ChangedSince, MatchesNameSubstringOf, HasTag)

View File

@ -27,8 +27,8 @@ class HandleClass(str):
@classmethod @classmethod
def get_schema(cls): def get_schema(cls):
from gramps.gen.lib import (Person, Family, Event, Place, Source, from . import (Person, Family, Event, Place, Source, Media, Repository,
Media, Repository, Note, Citation, Tag) Note, Citation, Tag)
tables = { tables = {
"Person": Person, "Person": Person,
"Family": Family, "Family": Family,

View File

@ -37,7 +37,7 @@ import time
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from .baseobj import BaseObject from .baseobj import BaseObject
from gramps.gen.errors import HandleError from ..errors import HandleError
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -26,9 +26,9 @@ import os
from .. import (Person, Family, Event, Source, Place, Citation, from .. import (Person, Family, Event, Source, Place, Citation,
Repository, Media, Note, Tag) Repository, Media, Note, Tag)
from ..serialize import to_json, from_json from ..serialize import to_json, from_json
from gramps.gen.db.utils import import_as_dict from ...db.utils import import_as_dict
from ...const import DATA_DIR
from gramps.cli.user import User from gramps.cli.user import User
from gramps.gen.const import DATA_DIR
TEST_DIR = os.path.abspath(os.path.join(DATA_DIR, "tests")) TEST_DIR = os.path.abspath(os.path.join(DATA_DIR, "tests"))
EXAMPLE = os.path.join(TEST_DIR, "example.gramps") EXAMPLE = os.path.join(TEST_DIR, "example.gramps")

View File

@ -31,12 +31,12 @@ import copy
import lxml.etree as ET import lxml.etree as ET
from gramps.plugins.lib.libgrampsxml import GRAMPS_XML_VERSION from gramps.plugins.lib.libgrampsxml import GRAMPS_XML_VERSION
from gramps.gen.const import DATA_DIR, USER_PLUGINS, TEMP_DIR
from gramps.version import VERSION
from gramps.gen.lib import Name, Surname
from gramps.test.test_util import Gramps from gramps.test.test_util import Gramps
from gramps.cli.user import User from gramps.cli.user import User
from gramps.gen.const import GRAMPS_LOCALE as glocale from ...const import DATA_DIR, USER_PLUGINS, TEMP_DIR
from ....version import VERSION
from ...lib import Name, Surname
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext _ = glocale.translation.sgettext
HAS_CLIMERGE = os.path.isdir(os.path.join(USER_PLUGINS, 'CliMerge')) HAS_CLIMERGE = os.path.isdir(os.path.join(USER_PLUGINS, 'CliMerge'))

View File

@ -39,7 +39,7 @@ import traceback
# Gramps modules # Gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.version import VERSION as GRAMPSVERSION, VERSION_TUPLE from ...version import VERSION as GRAMPSVERSION, VERSION_TUPLE
from ..const import IMAGE_DIR from ..const import IMAGE_DIR
from ..const import GRAMPS_LOCALE as glocale from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext

View File

@ -34,7 +34,7 @@
# Gramps modules # Gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale from ...const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext _ = glocale.translation.sgettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -29,7 +29,7 @@ Option class representing an enumerated list of possible values.
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from . import Option from . import Option
from gramps.gen.const import GRAMPS_LOCALE as glocale from ...const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext _ = glocale.translation.sgettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -64,7 +64,7 @@ from ...config import config
from ..docgen import PAPER_PORTRAIT from ..docgen import PAPER_PORTRAIT
from .. import _options from .. import _options
from .. import MenuOptions from .. import MenuOptions
from gramps.gen.utils.cast import get_type_converter from ...utils.cast import get_type_converter
def escxml(word): def escxml(word):
return escape(word, {'"' : '"'}) return escape(word, {'"' : '"'})

View File

@ -26,9 +26,9 @@
# Gramps modules # Gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.gen.utils.grampslocale import GrampsLocale from ...utils.grampslocale import GrampsLocale
from gramps.gen.display.name import NameDisplay from ...display.name import NameDisplay
from gramps.gen.config import config from ...config import config
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -28,13 +28,12 @@ Commonly used report options. Call the function, don't copy the code!
# gramps modules # gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale from ...config import config
from ...display.name import displayer as global_name_display
from ..menu import EnumeratedListOption, BooleanOption, NumberOption
from ...proxy import PrivateProxyDb, LivingProxyDb
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext _ = glocale.translation.sgettext
from gramps.gen.config import config
from gramps.gen.display.name import displayer as global_name_display
from gramps.gen.plug.menu import (EnumeratedListOption, BooleanOption,
NumberOption)
from gramps.gen.proxy import PrivateProxyDb, LivingProxyDb
# _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)

View File

@ -47,13 +47,13 @@ LOG = logging.getLogger(".gen.plug")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from ._pluginreg import make_environment from ._pluginreg import make_environment
from ..const import USER_PLUGINS from ..const import USER_PLUGINS
from gramps.version import VERSION_TUPLE from ...version import VERSION_TUPLE
from . import BasePluginManager from . import BasePluginManager
from ..utils.configmanager import safe_eval from ..utils.configmanager import safe_eval
from ..config import config from ..config import config
from ..constfunc import mac
from ..const import GRAMPS_LOCALE as glocale from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext _ = glocale.translation.sgettext
from ..constfunc import mac
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -22,7 +22,7 @@
Proxy class for the Gramps databases. Caches lookups from handles. Proxy class for the Gramps databases. Caches lookups from handles.
""" """
from gramps.gen.utils.lru import LRU from ..utils.lru import LRU
class CacheProxyDb: class CacheProxyDb:
""" """

View File

@ -33,7 +33,7 @@ from ..lib import (Date, Person, Name, Surname, NameOriginType, Family, Source,
Citation, Event, Media, Place, Repository, Note, Tag) Citation, Event, Media, Place, Repository, Note, Tag)
from ..utils.alive import probably_alive from ..utils.alive import probably_alive
from ..config import config from ..config import config
from gramps.gen.const import GRAMPS_LOCALE as glocale from ..const import GRAMPS_LOCALE as glocale
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -37,7 +37,7 @@ try:
except ImportError: except ImportError:
USE_LOCK = False USE_LOCK = False
from gramps.gen.const import HOME_DIR, GRAMPS_LOCALE as glocale from .const import HOME_DIR, GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -654,13 +654,13 @@ class GrampsLocale:
if self._dd: if self._dd:
return self._dd return self._dd
from gramps.gen.config import config from ..config import config
try: try:
val = config.get('preferences.date-format') val = config.get('preferences.date-format')
except AttributeError: except AttributeError:
val = 0; val = 0;
from gramps.gen.datehandler import LANG_TO_DISPLAY as displayers from ..datehandler import LANG_TO_DISPLAY as displayers
_first = self._GrampsLocale__first_instance _first = self._GrampsLocale__first_instance
if self.calendar in displayers: if self.calendar in displayers:
self._dd = displayers[self.calendar](val) self._dd = displayers[self.calendar](val)
@ -688,7 +688,7 @@ class GrampsLocale:
if self._dp: if self._dp:
return self._dp return self._dp
from gramps.gen.datehandler import LANG_TO_PARSER as parsers from ..datehandler import LANG_TO_PARSER as parsers
_first = self._GrampsLocale__first_instance _first = self._GrampsLocale__first_instance
if self.calendar in parsers: if self.calendar in parsers:
self._dp = parsers[self.calendar]() self._dp = parsers[self.calendar]()
@ -904,7 +904,7 @@ class GrampsLocale:
:returns: The name as text in the proper language. :returns: The name as text in the proper language.
:rtype: unicode :rtype: unicode
""" """
from gramps.gen.lib.grampstype import GrampsType from ..lib.grampstype import GrampsType
return GrampsType.xml_str(name) return GrampsType.xml_str(name)
def format(self, format, val, grouping=False, monetary=False): def format(self, format, val, grouping=False, monetary=False):

View File

@ -48,7 +48,7 @@ Keyword translation interface
# 'n' : nickname = nick name # 'n' : nickname = nick name
# 'g' : familynick = family nick name # 'g' : familynick = family nick name
from gramps.gen.const import GRAMPS_LOCALE as glocale from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
KEYWORDS = [("title", "t", _("Person|Title"), _("Person|TITLE")), KEYWORDS = [("title", "t", _("Person|Title"), _("Person|TITLE")),

View File

@ -38,9 +38,9 @@ import unittest
# Gramps modules # Gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.gen.const import TEMP_DIR, USER_HOME, USER_PLUGINS, VERSION from ...const import TEMP_DIR, USER_HOME, USER_PLUGINS, VERSION
from gramps.gen.utils.file import media_path, get_empty_tempdir from ...utils.file import media_path, get_empty_tempdir
from gramps.gen.db.utils import make_database from ...db.utils import make_database
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -34,7 +34,7 @@ import math
# Gramps modules # Gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.gen.utils.place import conv_lat_lon from ..place import conv_lat_lon
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #