From 9832e6712e7c896330c5a15ec469b6afaa005a32 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Tue, 2 Oct 2012 08:28:08 +0000 Subject: [PATCH] Coding Guidelines: relative import of gen in gen submodule svn: r20479 --- gramps/gen/datehandler/__init__.py | 2 +- gramps/gen/db/bsddbtxn.py | 2 +- gramps/gen/db/test/db_test.py | 14 +++++++------- gramps/gen/db/upgrade.py | 2 +- gramps/gen/dbstate.py | 8 ++++---- gramps/gen/lib/test/grampstype_test.py | 2 +- gramps/gen/merge/diff.py | 10 +++++----- gramps/gen/merge/mergecitationquery.py | 8 ++++---- gramps/gen/merge/mergeeventquery.py | 8 ++++---- gramps/gen/merge/mergefamilyquery.py | 8 ++++---- gramps/gen/merge/mergemediaquery.py | 8 ++++---- gramps/gen/merge/mergenotequery.py | 10 +++++----- gramps/gen/merge/mergepersonquery.py | 6 +++--- gramps/gen/merge/mergeplacequery.py | 8 ++++---- gramps/gen/merge/mergerepositoryquery.py | 8 ++++---- gramps/gen/merge/mergesourcequery.py | 10 +++++----- gramps/gen/merge/test/merge_ref_test.py | 2 +- gramps/gen/mime/_gnomemime.py | 2 +- gramps/gen/mime/_pythonmime.py | 2 +- gramps/gen/mime/_winmime.py | 2 +- gramps/gen/plug/docbackend/docbackend.py | 2 +- gramps/gen/plug/report/_constants.py | 7 +++---- gramps/gen/plug/report/_options.py | 10 +++++----- gramps/gen/plug/report/_paper.py | 8 ++++---- gramps/gen/plug/report/endnotes.py | 10 +++++----- gramps/gen/plug/report/utils.py | 2 +- gramps/gen/proxy/filter.py | 1 - gramps/gen/proxy/living.py | 6 +++--- gramps/gen/proxy/private.py | 8 ++++---- gramps/gen/proxy/proxybase.py | 2 +- gramps/gen/recentfiles.py | 2 +- gramps/gen/relationship.py | 2 +- gramps/gen/simple/_simpledoc.py | 2 +- gramps/gen/simple/_simpletable.py | 2 +- gramps/gen/sort.py | 6 +++--- gramps/gen/utils/alive.py | 6 +++--- gramps/gen/utils/docgen/ODSTab.py | 8 +++----- gramps/gen/utils/image.py | 2 +- gramps/gen/utils/lds.py | 4 ++-- gramps/gen/utils/test/callback_test.py | 2 +- gramps/gen/utils/trans.py | 4 ++-- 41 files changed, 107 insertions(+), 111 deletions(-) diff --git a/gramps/gen/datehandler/__init__.py b/gramps/gen/datehandler/__init__.py index 84a362ddd..8ea34cd50 100644 --- a/gramps/gen/datehandler/__init__.py +++ b/gramps/gen/datehandler/__init__.py @@ -62,7 +62,7 @@ except: # Initialize global displayer try: - from gen.config import config + from ..config import config val = config.get('preferences.date-format') except: val = 0 diff --git a/gramps/gen/db/bsddbtxn.py b/gramps/gen/db/bsddbtxn.py index bc8383f34..1bede1ca7 100644 --- a/gramps/gen/db/bsddbtxn.py +++ b/gramps/gen/db/bsddbtxn.py @@ -188,7 +188,7 @@ class BSDDBTxn(object): # test code if __name__ == "__main__": print "1" - from gen.config import config + from ..config import config if config.get('preferences.use-bsddb3'): from bsddb3 import db, dbshelve else: diff --git a/gramps/gen/db/test/db_test.py b/gramps/gen/db/test/db_test.py index b12ace900..15fa100a8 100644 --- a/gramps/gen/db/test/db_test.py +++ b/gramps/gen/db/test/db_test.py @@ -21,10 +21,10 @@ # gen/db/test/db_test.py # $Id$ -from gen.db import (DbReadBase, DbWriteBase, +from ..db import (DbReadBase, DbWriteBase, DbBsddbRead, DbBsddb) -from gen.proxy.proxybase import ProxyDbBase -from gen.proxy import LivingProxyDb +from ...proxy.proxybase import ProxyDbBase +from ...proxy import LivingProxyDb class DbTest(object): READ_METHODS = [ @@ -263,20 +263,20 @@ db1._verify_readonly() db2 = DbTest(DbWriteBase()) db2._verify_readwrite() -from gen.db import DbBsddbRead +from .. import DbBsddbRead db3 = DbTest(DbBsddbRead()) db3._verify_readonly() -from gen.db import DbBsddb +from .. import DbBsddb db4 = DbTest(DbBsddb()) db4._verify_readwrite() -from gen.proxy.proxybase import ProxyDbBase +from ...proxy.proxybase import ProxyDbBase gdb = DbBsddb() db5 = DbTest(ProxyDbBase(gdb)) db5._verify_readonly() -from gen.proxy import LivingProxyDb +from ...proxy import LivingProxyDb gdb = DbBsddb() db6 = DbTest(LivingProxyDb(gdb, LivingProxyDb.MODE_EXCLUDE_ALL)) db6._verify_readonly() diff --git a/gramps/gen/db/upgrade.py b/gramps/gen/db/upgrade.py index 54574fc46..a20dbdfdc 100644 --- a/gramps/gen/db/upgrade.py +++ b/gramps/gen/db/upgrade.py @@ -29,7 +29,7 @@ import time import logging LOG = logging.getLogger(".citation") -from gen.ggettext import gettext as _ +from ..ggettext import gettext as _ """ methods to upgrade a database from version 13 to current version diff --git a/gramps/gen/dbstate.py b/gramps/gen/dbstate.py index 156fcb420..1b958ac51 100644 --- a/gramps/gen/dbstate.py +++ b/gramps/gen/dbstate.py @@ -25,10 +25,10 @@ Provide the database state class """ -from gen.db import DbBsddbRead -from gen.proxy.proxybase import ProxyDbBase -from gen.utils.callback import Callback -from gen.config import config +from db import DbBsddbRead +from proxy.proxybase import ProxyDbBase +from utils.callback import Callback +from config import config class DbState(Callback): """ diff --git a/gramps/gen/lib/test/grampstype_test.py b/gramps/gen/lib/test/grampstype_test.py index f1dca3bfe..a025138f3 100644 --- a/gramps/gen/lib/test/grampstype_test.py +++ b/gramps/gen/lib/test/grampstype_test.py @@ -26,7 +26,7 @@ import unittest as U from test.test_util import msg -from gen.lib.grampstype import GrampsType, _init_map +from ..grampstype import GrampsType, _init_map # some simple map items to test with vals = "zz ab cd ef".split() diff --git a/gramps/gen/merge/diff.py b/gramps/gen/merge/diff.py index c2f586841..ab7076bd7 100644 --- a/gramps/gen/merge/diff.py +++ b/gramps/gen/merge/diff.py @@ -25,11 +25,11 @@ This package implements an object difference engine. """ import os -import cli.user -from gen.dbstate import DbState -from cli.grampscli import CLIManager -from gen.plug import BasePluginManager -from gen.db.dictionary import DictionaryDb +import gramps.cli.user +from ..dbstate import DbState +from gramps.cli.grampscli import CLIManager +from ..plug import BasePluginManager +from ..db.dictionary import DictionaryDb def import_as_dict(filename): """ diff --git a/gramps/gen/merge/mergecitationquery.py b/gramps/gen/merge/mergecitationquery.py index b5910d05f..b5158245d 100644 --- a/gramps/gen/merge/mergecitationquery.py +++ b/gramps/gen/merge/mergecitationquery.py @@ -30,10 +30,10 @@ Provide merge capabilities for citations. # Gramps modules # #------------------------------------------------------------------------- -from gen.lib import (Person, Family, Event, Place, MediaObject, Repository) -from gen.db import DbTxn -from gen.ggettext import sgettext as _ -from gen.errors import MergeError +from ..lib import (Person, Family, Event, Place, MediaObject, Repository) +from ..db import DbTxn +from ..ggettext import sgettext as _ +from ..errors import MergeError #------------------------------------------------------------------------- # diff --git a/gramps/gen/merge/mergeeventquery.py b/gramps/gen/merge/mergeeventquery.py index e1b1e3b90..fb86da3c5 100644 --- a/gramps/gen/merge/mergeeventquery.py +++ b/gramps/gen/merge/mergeeventquery.py @@ -29,10 +29,10 @@ Provide merge capabilities for events. # Gramps modules # #------------------------------------------------------------------------- -from gen.lib import Person, Family -from gen.db import DbTxn -from gen.ggettext import sgettext as _ -from gen.errors import MergeError +from ..lib import Person, Family +from ..db import DbTxn +from ..ggettext import sgettext as _ +from ..errors import MergeError #------------------------------------------------------------------------- # diff --git a/gramps/gen/merge/mergefamilyquery.py b/gramps/gen/merge/mergefamilyquery.py index b0c445e78..b27212dce 100644 --- a/gramps/gen/merge/mergefamilyquery.py +++ b/gramps/gen/merge/mergefamilyquery.py @@ -29,10 +29,10 @@ Provide merge capabilities for families. # Gramps modules # #------------------------------------------------------------------------- -from gen.db import DbTxn -from gen.ggettext import sgettext as _ -from gen.errors import MergeError -from gen.merge import MergePersonQuery +from ..db import DbTxn +from ..ggettext import sgettext as _ +from ..errors import MergeError +from . import MergePersonQuery #------------------------------------------------------------------------- # diff --git a/gramps/gen/merge/mergemediaquery.py b/gramps/gen/merge/mergemediaquery.py index de35a6798..d021a1c64 100644 --- a/gramps/gen/merge/mergemediaquery.py +++ b/gramps/gen/merge/mergemediaquery.py @@ -29,10 +29,10 @@ Provide merge capabilities for media objects. # Gramps modules # #------------------------------------------------------------------------- -from gen.lib import Person, Family, Event, Source, Citation, Place -from gen.db import DbTxn -from gen.ggettext import sgettext as _ -from gen.errors import MergeError +from ..lib import Person, Family, Event, Source, Citation, Place +from ..db import DbTxn +from ..ggettext import sgettext as _ +from ..errors import MergeError #------------------------------------------------------------------------- # diff --git a/gramps/gen/merge/mergenotequery.py b/gramps/gen/merge/mergenotequery.py index 8e2ca81c0..ddb6f1228 100644 --- a/gramps/gen/merge/mergenotequery.py +++ b/gramps/gen/merge/mergenotequery.py @@ -29,11 +29,11 @@ Provide merge capabilities for notes. # Gramps modules # #------------------------------------------------------------------------- -from gen.lib import (Person, Family, Event, Place, Source, Citation, Repository, - MediaObject) -from gen.db import DbTxn -from gen.ggettext import sgettext as _ -from gen.errors import MergeError +from ..lib import (Person, Family, Event, Place, Source, Citation, Repository, + MediaObject) +from ..db import DbTxn +from ..ggettext import sgettext as _ +from ..errors import MergeError #------------------------------------------------------------------------- # diff --git a/gramps/gen/merge/mergepersonquery.py b/gramps/gen/merge/mergepersonquery.py index e658b2e47..e05d6f812 100644 --- a/gramps/gen/merge/mergepersonquery.py +++ b/gramps/gen/merge/mergepersonquery.py @@ -31,9 +31,9 @@ Provide merge capabilities for persons. # Gramps modules # #------------------------------------------------------------------------- -from gen.db import DbTxn -from gen.ggettext import sgettext as _ -from gen.errors import MergeError +from ..db import DbTxn +from ..ggettext import sgettext as _ +from ..errors import MergeError #------------------------------------------------------------------------- # diff --git a/gramps/gen/merge/mergeplacequery.py b/gramps/gen/merge/mergeplacequery.py index c4307dc5d..4a115dab0 100644 --- a/gramps/gen/merge/mergeplacequery.py +++ b/gramps/gen/merge/mergeplacequery.py @@ -30,10 +30,10 @@ Provide merge capabilities for places. # Gramps modules # #------------------------------------------------------------------------- -from gen.lib import Person, Family, Event -from gen.db import DbTxn -from gen.ggettext import sgettext as _ -from gen.errors import MergeError +from ..lib import Person, Family, Event +from ..db import DbTxn +from ..ggettext import sgettext as _ +from ..errors import MergeError #------------------------------------------------------------------------- # diff --git a/gramps/gen/merge/mergerepositoryquery.py b/gramps/gen/merge/mergerepositoryquery.py index d53e0233d..3e9b47cb4 100644 --- a/gramps/gen/merge/mergerepositoryquery.py +++ b/gramps/gen/merge/mergerepositoryquery.py @@ -29,10 +29,10 @@ Provide merge capabilities for repositories. # Gramps modules # #------------------------------------------------------------------------- -from gen.lib import Source -from gen.db import DbTxn -from gen.ggettext import sgettext as _ -from gen.errors import MergeError +from ..lib import Source +from ..db import DbTxn +from ..ggettext import sgettext as _ +from ..errors import MergeError #------------------------------------------------------------------------- # diff --git a/gramps/gen/merge/mergesourcequery.py b/gramps/gen/merge/mergesourcequery.py index c265add48..200a6ae88 100644 --- a/gramps/gen/merge/mergesourcequery.py +++ b/gramps/gen/merge/mergesourcequery.py @@ -31,11 +31,11 @@ Provide merge capabilities for sources. # Gramps modules # #------------------------------------------------------------------------- -from gen.lib import (Person, Family, Event, Place, Source, Repository, - MediaObject, Citation) -from gen.db import DbTxn -from gen.ggettext import sgettext as _ -from gen.errors import MergeError +from ..lib import (Person, Family, Event, Place, Source, Repository, + MediaObject, Citation) +from ..db import DbTxn +from ..ggettext import sgettext as _ +from ..errors import MergeError #------------------------------------------------------------------------- # diff --git a/gramps/gen/merge/test/merge_ref_test.py b/gramps/gen/merge/test/merge_ref_test.py index 35ab32f7a..c7ef9202d 100644 --- a/gramps/gen/merge/test/merge_ref_test.py +++ b/gramps/gen/merge/test/merge_ref_test.py @@ -36,7 +36,7 @@ import libxml2 import libxslt from libgrampsxml import GRAMPS_XML_VERSION -from gen.const import ROOT_DIR, VERSION, USER_PLUGINS +from ...const import ROOT_DIR, VERSION, USER_PLUGINS from ...lib import Name, Surname from ...ggettext import sgettext as _ diff --git a/gramps/gen/mime/_gnomemime.py b/gramps/gen/mime/_gnomemime.py index 07fd32d51..3e3040d5e 100644 --- a/gramps/gen/mime/_gnomemime.py +++ b/gramps/gen/mime/_gnomemime.py @@ -29,7 +29,7 @@ except: from gnome.vfs import mime_get_short_list_applications, \ mime_get_description, get_mime_type, mime_get_default_application -from gen.ggettext import gettext as _ +from ..ggettext import gettext as _ def get_description(type): """Return the description of the specified mime type.""" diff --git a/gramps/gen/mime/_pythonmime.py b/gramps/gen/mime/_pythonmime.py index 4b470a72d..a06ac353b 100644 --- a/gramps/gen/mime/_pythonmime.py +++ b/gramps/gen/mime/_pythonmime.py @@ -22,7 +22,7 @@ # import mimetypes -from gen.ggettext import gettext as _ +from ..ggettext import gettext as _ _type_map = { 'application/x-gramps' : 'Gramps database', diff --git a/gramps/gen/mime/_winmime.py b/gramps/gen/mime/_winmime.py index 8834d1466..513c6e4dd 100644 --- a/gramps/gen/mime/_winmime.py +++ b/gramps/gen/mime/_winmime.py @@ -38,7 +38,7 @@ from _winreg import * # #------------------------------------------------------------------------- import _pythonmime -from gen.ggettext import gettext as _ +from ..ggettext import gettext as _ def get_description(mime_type): """Return the description of the specfied mime type""" diff --git a/gramps/gen/plug/docbackend/docbackend.py b/gramps/gen/plug/docbackend/docbackend.py index f2cdb8781..c9d7e82f7 100644 --- a/gramps/gen/plug/docbackend/docbackend.py +++ b/gramps/gen/plug/docbackend/docbackend.py @@ -28,7 +28,7 @@ # Python modules # #------------------------------------------------------------------------ -from gen.ggettext import gettext as _ +from ...ggettext import gettext as _ #------------------------------------------------------------------------- # diff --git a/gramps/gen/plug/report/_constants.py b/gramps/gen/plug/report/_constants.py index 0c60e7784..f822f6720 100644 --- a/gramps/gen/plug/report/_constants.py +++ b/gramps/gen/plug/report/_constants.py @@ -29,7 +29,7 @@ # standard python modules # #------------------------------------------------------------------------- -from gen.ggettext import gettext as _ +from ...ggettext import gettext as _ import os #------------------------------------------------------------------------- @@ -39,8 +39,8 @@ import os #------------------------------------------------------------------------- # Report categories -from gen.plug import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_CODE, CATEGORY_WEB,\ - CATEGORY_BOOK, CATEGORY_GRAPHVIZ +from .. import (CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_CODE, CATEGORY_WEB, + CATEGORY_BOOK, CATEGORY_GRAPHVIZ) standalone_categories = { CATEGORY_TEXT : _("Text Reports"), @@ -55,4 +55,3 @@ book_categories = { CATEGORY_TEXT : _("Text"), CATEGORY_DRAW : _("Graphics"), } - diff --git a/gramps/gen/plug/report/_options.py b/gramps/gen/plug/report/_options.py index 7dc1b92e6..42d4af679 100644 --- a/gramps/gen/plug/report/_options.py +++ b/gramps/gen/plug/report/_options.py @@ -57,11 +57,11 @@ except: # (do not import anything from 'gui' as this is in 'gen') # #------------------------------------------------------------------------- -from gen.const import HOME_DIR, REPORT_OPTIONS -from gen.config import config -from gen.plug.docgen import PAPER_PORTRAIT -from gen.plug import _options -from gen.plug import MenuOptions +from ...const import HOME_DIR, REPORT_OPTIONS +from ...config import config +from ..docgen import PAPER_PORTRAIT +from .. import _options +from .. import MenuOptions #------------------------------------------------------------------------- # diff --git a/gramps/gen/plug/report/_paper.py b/gramps/gen/plug/report/_paper.py index c100afa93..5513674fb 100644 --- a/gramps/gen/plug/report/_paper.py +++ b/gramps/gen/plug/report/_paper.py @@ -26,16 +26,16 @@ # Python modules # #------------------------------------------------------------------------- -from gen.ggettext import sgettext as _ +from ...ggettext import sgettext as _ #------------------------------------------------------------------------- # # GRAMPS modules # #------------------------------------------------------------------------- -from gen.plug.utils import gfloat -from gen.plug.docgen import PaperSize -from gen.const import PAPERSIZE +from ..utils import gfloat +from ..docgen import PaperSize +from ...const import PAPERSIZE #------------------------------------------------------------------------- # diff --git a/gramps/gen/plug/report/endnotes.py b/gramps/gen/plug/report/endnotes.py index a316eab18..c1a030b08 100644 --- a/gramps/gen/plug/report/endnotes.py +++ b/gramps/gen/plug/report/endnotes.py @@ -26,11 +26,11 @@ """ Provide utilities for printing endnotes in text reports. """ -from gen.plug.docgen import FontStyle, ParagraphStyle, FONT_SANS_SERIF -from gen.lib import NoteType, Citation -from gen.ggettext import gettext as _ -from gen.utils.string import confidence -from gen.datehandler import displayer +from ..docgen import FontStyle, ParagraphStyle, FONT_SANS_SERIF +from ...lib import NoteType, Citation +from ...ggettext import gettext as _ +from ...utils.string import confidence +from ....datehandler import displayer def add_endnote_styles(style_sheet): """ diff --git a/gramps/gen/plug/report/utils.py b/gramps/gen/plug/report/utils.py index 78587d492..c7d86b38d 100644 --- a/gramps/gen/plug/report/utils.py +++ b/gramps/gen/plug/report/utils.py @@ -34,7 +34,7 @@ A collection of utilities to aid in the generation of reports. # #------------------------------------------------------------------------- import os -from gen.ggettext import gettext as _ +from ...ggettext import gettext as _ #------------------------------------------------------------------------ # diff --git a/gramps/gen/proxy/filter.py b/gramps/gen/proxy/filter.py index 27fdd99f7..59f6db582 100644 --- a/gramps/gen/proxy/filter.py +++ b/gramps/gen/proxy/filter.py @@ -39,7 +39,6 @@ from itertools import imap # GRAMPS libraries # #------------------------------------------------------------------------- -#from gen.lib import * from proxybase import ProxyDbBase class FilterProxyDb(ProxyDbBase): diff --git a/gramps/gen/proxy/living.py b/gramps/gen/proxy/living.py index ebe578c54..1b566ab9b 100644 --- a/gramps/gen/proxy/living.py +++ b/gramps/gen/proxy/living.py @@ -37,9 +37,9 @@ from itertools import ifilter # #------------------------------------------------------------------------- from proxybase import ProxyDbBase -from gen.lib import Date, Person, Name, Surname, NameOriginType -from gen.utils.alive import probably_alive -from gen.config import config +from ..lib import Date, Person, Name, Surname, NameOriginType +from ..utils.alive import probably_alive +from ..config import config #------------------------------------------------------------------------- # diff --git a/gramps/gen/proxy/private.py b/gramps/gen/proxy/private.py index f09f19893..92009565d 100644 --- a/gramps/gen/proxy/private.py +++ b/gramps/gen/proxy/private.py @@ -31,7 +31,7 @@ Proxy class for the GRAMPS databases. Filter out all data marked private. # Python libraries # #------------------------------------------------------------------------- -from gen.ggettext import gettext as _ +from ..ggettext import gettext as _ import logging LOG = logging.getLogger(".citation") @@ -40,9 +40,9 @@ LOG = logging.getLogger(".citation") # GRAMPS libraries # #------------------------------------------------------------------------- -from gen.lib import (MediaRef, Attribute, Address, EventRef, - Person, Name, Source, RepoRef, MediaObject, Place, Event, - Family, ChildRef, Repository, LdsOrd, Surname, Citation) +from ..lib import (MediaRef, Attribute, Address, EventRef, + Person, Name, Source, RepoRef, MediaObject, Place, Event, + Family, ChildRef, Repository, LdsOrd, Surname, Citation) from proxybase import ProxyDbBase class PrivateProxyDb(ProxyDbBase): diff --git a/gramps/gen/proxy/proxybase.py b/gramps/gen/proxy/proxybase.py index 3a360702c..0dc74c09a 100644 --- a/gramps/gen/proxy/proxybase.py +++ b/gramps/gen/proxy/proxybase.py @@ -38,7 +38,7 @@ import types # GRAMPS libraries # #------------------------------------------------------------------------- -from gen.db.base import DbReadBase, DbWriteBase +from ..db.base import DbReadBase, DbWriteBase class ProxyCursor(object): """ diff --git a/gramps/gen/recentfiles.py b/gramps/gen/recentfiles.py index a1b5d7263..099aea02b 100644 --- a/gramps/gen/recentfiles.py +++ b/gramps/gen/recentfiles.py @@ -37,7 +37,7 @@ try: except: use_lock = False -from gen.const import HOME_DIR +from const import HOME_DIR #------------------------------------------------------------------------- # diff --git a/gramps/gen/relationship.py b/gramps/gen/relationship.py index 16be1f809..14e9f6be2 100644 --- a/gramps/gen/relationship.py +++ b/gramps/gen/relationship.py @@ -401,7 +401,7 @@ class RelationshipCalculator(object): self.__db_connected = False self.depth = 15 try: - from gen.config import config + from config import config self.set_depth(config.get('behavior.generation-depth')) except ImportError: pass diff --git a/gramps/gen/simple/_simpledoc.py b/gramps/gen/simple/_simpledoc.py index 3e072990e..c33953929 100644 --- a/gramps/gen/simple/_simpledoc.py +++ b/gramps/gen/simple/_simpledoc.py @@ -23,7 +23,7 @@ """ Provide a simplified database access interface to the GRAMPS database. """ -from gen.plug.docgen import StyleSheet, ParagraphStyle, TableStyle,\ +from ..plug.docgen import StyleSheet, ParagraphStyle, TableStyle,\ TableCellStyle, FONT_SANS_SERIF, PARA_ALIGN_LEFT class SimpleDoc(object): diff --git a/gramps/gen/simple/_simpletable.py b/gramps/gen/simple/_simpletable.py index 22c150f14..1dea55336 100644 --- a/gramps/gen/simple/_simpletable.py +++ b/gramps/gen/simple/_simpletable.py @@ -27,7 +27,7 @@ Provide a simplified table creation interface """ import cgi -from gen.ggettext import sgettext as _ +from ..ggettext import sgettext as _ from ..lib import (Person, Family, Event, Source, Place, Citation, Repository, MediaObject, Note, Date, Span) from ..config import config diff --git a/gramps/gen/sort.py b/gramps/gen/sort.py index bdaf60a23..74da678ed 100644 --- a/gramps/gen/sort.py +++ b/gramps/gen/sort.py @@ -39,9 +39,9 @@ import locale # GRAMPS Modules # #------------------------------------------------------------------------- -from gen.lib import Date -from gen.utils.db import get_birth_or_fallback -from gen.display.name import displayer as _nd +from lib import Date +from utils.db import get_birth_or_fallback +from display.name import displayer as _nd #------------------------------------------------------------------------- # diff --git a/gramps/gen/utils/alive.py b/gramps/gen/utils/alive.py index 907c46345..8408bddc0 100644 --- a/gramps/gen/utils/alive.py +++ b/gramps/gen/utils/alive.py @@ -52,7 +52,7 @@ from ..ggettext import sgettext as _ #------------------------------------------------------------------------- # cache values; use refresh_constants() if they change try: - from gen.config import config + from ..config import config _MAX_AGE_PROB_ALIVE = config.get('behavior.max-age-prob-alive') _MAX_SIB_AGE_DIFF = config.get('behavior.max-sib-age-diff') _AVG_GENERATION_GAP = config.get('behavior.avg-generation-gap') @@ -499,7 +499,7 @@ def probably_alive_range(person, db, """ # First, find the real database to use all people # for determining alive status: - from gen.proxy.proxybase import ProxyDbBase + from ..proxy.proxybase import ProxyDbBase basedb = db while isinstance(basedb, ProxyDbBase): basedb = basedb.db @@ -512,7 +512,7 @@ def update_constants(): """ Used to update the constants that are cached in this module. """ - from gen.config import config + from ..config import config global _MAX_AGE_PROB_ALIVE, _MAX_SIB_AGE_DIFF, _AVG_GENERATION_GAP _MAX_AGE_PROB_ALIVE = config.get('behavior.max-age-prob-alive') _MAX_SIB_AGE_DIFF = config.get('behavior.max-sib-age-diff') diff --git a/gramps/gen/utils/docgen/ODSTab.py b/gramps/gen/utils/docgen/ODSTab.py index d166b76ef..573cb8da0 100644 --- a/gramps/gen/utils/docgen/ODSTab.py +++ b/gramps/gen/utils/docgen/ODSTab.py @@ -28,7 +28,7 @@ import os import tempfile import zipfile -from gen.ggettext import gettext as _ +from ...ggettext import gettext as _ #------------------------------------------------------------------------- # @@ -36,10 +36,8 @@ from gen.ggettext import gettext as _ # #------------------------------------------------------------------------- from TabbedDoc import * - -from gen.const import PROGRAM_NAME, VERSION - -from gen.errors import ReportError +from ...const import PROGRAM_NAME, VERSION +from ...errors import ReportError #------------------------------------------------------------------------- # diff --git a/gramps/gen/utils/image.py b/gramps/gen/utils/image.py index 0a4066788..fd2f0d5a7 100644 --- a/gramps/gen/utils/image.py +++ b/gramps/gen/utils/image.py @@ -44,7 +44,7 @@ import tempfile # Gramps modules # #------------------------------------------------------------------------- -from gen.utils.file import get_unicode_path_from_env_var +from file import get_unicode_path_from_env_var #------------------------------------------------------------------------- # diff --git a/gramps/gen/utils/lds.py b/gramps/gen/utils/lds.py index 165308dcd..6ab218591 100644 --- a/gramps/gen/utils/lds.py +++ b/gramps/gen/utils/lds.py @@ -24,12 +24,12 @@ Parses the lds.xml file to build the temple/code maps """ -from gen.const import DATA_DIR +from ..const import DATA_DIR import os import logging from xml.parsers.expat import ParserCreate -from gen.ggettext import gettext as _ +from ..ggettext import gettext as _ LOG = logging.getLogger(".") diff --git a/gramps/gen/utils/test/callback_test.py b/gramps/gen/utils/test/callback_test.py index bd442fac8..198a6e9df 100644 --- a/gramps/gen/utils/test/callback_test.py +++ b/gramps/gen/utils/test/callback_test.py @@ -26,7 +26,7 @@ import unittest from test import test_util as tu tu.path_append_parent() -from gen.utils.callback import Callback +from ..callback import Callback try: log diff --git a/gramps/gen/utils/trans.py b/gramps/gen/utils/trans.py index 1ffa9a833..ff1d69f36 100644 --- a/gramps/gen/utils/trans.py +++ b/gramps/gen/utils/trans.py @@ -265,7 +265,7 @@ def get_addon_translator(filename=None, domain="addon", languages=None): # Check if path is of type str. Do import and conversion if so. # The import cannot be done at the top as that will conflict with the translation system. if type(path) == str: - from gen.utils.file import get_unicode_path_from_env_var + from file import get_unicode_path_from_env_var path = get_unicode_path_from_env_var(path) if languages: addon_translator = gettext.translation(domain, os.path.join(path,"locale"), @@ -305,7 +305,7 @@ def trans_objclass(objclass_str): Translates objclass_str into "... %s", where objclass_str is 'Person', 'person', 'Family', 'family', etc. """ - from gen.ggettext import gettext as _ + from ..ggettext import gettext as _ objclass = objclass_str.lower() if objclass == "person": return _("the person")