diff --git a/gramps/gui/aboutdialog.py b/gramps/gui/aboutdialog.py index 6e7ed13b9..50924e1cb 100644 --- a/gramps/gui/aboutdialog.py +++ b/gramps/gui/aboutdialog.py @@ -56,7 +56,7 @@ from gi.repository import GdkPixbuf from gramps.gen.const import (AUTHORS, AUTHORS_FILE, COMMENTS, COPYRIGHT_MSG, DOCUMENTERS, LICENSE_FILE, PROGRAM_NAME, SPLASH, TRANSLATORS, URL_HOMEPAGE, VERSION) -from gramps.gui.display import display_url +from .display import display_url from gramps.gen.config import config if config.get('preferences.use-bsddb3'): diff --git a/gramps/gui/clipboard.py b/gramps/gui/clipboard.py index 0e400d0b2..d85b64257 100644 --- a/gramps/gui/clipboard.py +++ b/gramps/gui/clipboard.py @@ -50,15 +50,15 @@ from gramps.gen.const import IMAGE_DIR, URL_MANUAL_PAGE from gramps.gen.config import config from gramps.gen.lib import NoteType from gramps.gen.datehandler import get_date -from gramps.gui.display import display_help -from gramps.gui.managedwindow import ManagedWindow +from .display import display_help +from .managedwindow import ManagedWindow from gramps.gen.ggettext import sgettext as _ from gramps.gen.utils.trans import trans_objclass from gramps.gen.constfunc import mac -from gramps.gui.glade import Glade -from gramps.gui.ddtargets import DdTargets -from gramps.gui.makefilter import make_filter -from gramps.gui.utils import is_right_click +from .glade import Glade +from .ddtargets import DdTargets +from .makefilter import make_filter +from .utils import is_right_click #------------------------------------------------------------------------- # @@ -1517,7 +1517,7 @@ class MultiTreeView(Gtk.TreeView): self.defer_select=False def edit_obj(self, objclass, handle): - from gramps.gui.editors import (EditPerson, EditEvent, EditFamily, EditSource, + from .editors import (EditPerson, EditEvent, EditFamily, EditSource, EditPlace, EditRepository, EditNote, EditMedia) if objclass == 'Person': person = self.dbstate.db.get_person_from_handle(handle) diff --git a/gramps/gui/columnorder.py b/gramps/gui/columnorder.py index 70e402f0a..57894487a 100644 --- a/gramps/gui/columnorder.py +++ b/gramps/gui/columnorder.py @@ -48,8 +48,8 @@ from gi.repository import GObject # GRAMPS modules # #------------------------------------------------------------------------- -from gramps.gui.managedwindow import ManagedWindow -from gramps.gui.glade import Glade +from .managedwindow import ManagedWindow +from .glade import Glade #------------------------------------------------------------------------- diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py index a40020417..35c1c4eb4 100644 --- a/gramps/gui/configure.py +++ b/gramps/gui/configure.py @@ -58,10 +58,10 @@ from gramps.gen.utils.keyword import (get_keywords, get_translation_from_keyword get_translations, get_keyword_from_translation) from gramps.gen.lib import Date, FamilyRelType from gramps.gen.lib import Name, Surname, NameOriginType -from gramps.gui.managedwindow import ManagedWindow -from gramps.gui.widgets import MarkupLabel, BasicLabel -from gramps.gui.dialog import ErrorDialog, QuestionDialog2, OkDialog -from gramps.gui.glade import Glade +from .managedwindow import ManagedWindow +from .widgets import MarkupLabel, BasicLabel +from .dialog import ErrorDialog, QuestionDialog2, OkDialog +from .glade import Glade #------------------------------------------------------------------------- # diff --git a/gramps/gui/dbloader.py b/gramps/gui/dbloader.py index 21c80b193..ded7f4907 100644 --- a/gramps/gui/dbloader.py +++ b/gramps/gui/dbloader.py @@ -62,10 +62,10 @@ from gramps.gen.db.exceptions import (DbUpgradeRequiredError, DbVersionError, DbEnvironmentError) from gramps.gen.utils.file import get_unicode_path_from_file_chooser -from gramps.gui.pluginmanager import GuiPluginManager -from gramps.gui.dialog import (DBErrorDialog, ErrorDialog, QuestionDialog2, +from .pluginmanager import GuiPluginManager +from .dialog import (DBErrorDialog, ErrorDialog, QuestionDialog2, WarningDialog) -from gramps.gui.user import User +from .user import User from gramps.gen.errors import DbError #------------------------------------------------------------------------- diff --git a/gramps/gui/dbman.py b/gramps/gui/dbman.py index 5ce8766f8..bf340abcf 100644 --- a/gramps/gui/dbman.py +++ b/gramps/gui/dbman.py @@ -70,14 +70,14 @@ from gi.repository import Pango # #------------------------------------------------------------------------- from gramps.gen.ggettext import gettext as _ -from gramps.gui.user import User -from gramps.gui.dialog import ErrorDialog, QuestionDialog, QuestionDialog2 +from .user import User +from .dialog import ErrorDialog, QuestionDialog, QuestionDialog2 from gramps.gen.db import DbBsddb -from gramps.gui.pluginmanager import GuiPluginManager +from .pluginmanager import GuiPluginManager from gramps.cli.clidbman import CLIDbManager, NAME_FILE, time_val -from gramps.gui.ddtargets import DdTargets +from .ddtargets import DdTargets from gramps.gen.recentfiles import rename_filename, remove_filename -from gramps.gui.glade import Glade +from .glade import Glade from gramps.gen.db.backup import restore from gramps.gen.db.exceptions import DbException from gramps.gen.utils.file import get_unicode_path_from_env_var diff --git a/gramps/gui/ddtargets.py b/gramps/gui/ddtargets.py index d7d016f54..1a37aed63 100644 --- a/gramps/gui/ddtargets.py +++ b/gramps/gui/ddtargets.py @@ -39,7 +39,7 @@ The module defines a singleton instance of _DdTargets called DdTargets. - from gramps.gui.ddtargets import DdTargets + from .ddtargets import DdTargets drag_dest_set(Gtk.DestDefaults.ALL, DdTargets.all_targets(), diff --git a/gramps/gui/dialog.py b/gramps/gui/dialog.py index 22810a0d8..3bfb2aa60 100644 --- a/gramps/gui/dialog.py +++ b/gramps/gui/dialog.py @@ -45,7 +45,7 @@ from gi.repository import GdkPixbuf #------------------------------------------------------------------------- from gramps.gen.const import ICON from gramps.gen.config import config -from gramps.gui.glade import Glade +from .glade import Glade from gramps.gen.ggettext import gettext as _ try: diff --git a/gramps/gui/displaystate.py b/gramps/gui/displaystate.py index 95cef04e3..46068bcf0 100644 --- a/gramps/gui/displaystate.py +++ b/gramps/gui/displaystate.py @@ -55,13 +55,13 @@ from gi.repository import GObject # #------------------------------------------------------------------------- from gramps.gen.utils.callback import Callback -from gramps.gui.utils import process_pending_events -from gramps.gui.views.navigationview import NavigationView +from .utils import process_pending_events +from .views.navigationview import NavigationView from gramps.gen.config import config from gramps.gen.display.name import displayer as name_displayer -from gramps.gui.managedwindow import GrampsWindowManager +from .managedwindow import GrampsWindowManager from gramps.gen.relationship import get_relationship_calculator -from gramps.gui.glade import Glade +from .glade import Glade from gramps.gen.utils.db import navigation_label DISABLED = -1 @@ -306,7 +306,7 @@ def by_time(first, second): return cmp(second.get_time(), first.get_time()) -from gramps.gui.logger import RotateHandler +from .logger import RotateHandler class WarnHandler(RotateHandler): diff --git a/gramps/gui/grampsbar.py b/gramps/gui/grampsbar.py index f8b07b9c1..014a6267e 100644 --- a/gramps/gui/grampsbar.py +++ b/gramps/gui/grampsbar.py @@ -48,18 +48,18 @@ from gi.repository import Gtk # #------------------------------------------------------------------------- from gramps.gen.const import URL_MANUAL_PAGE, VERSION_DIR -from gramps.gui.managedwindow import ManagedWindow -from gramps.gui.display import display_help, display_url -from gramps.gui.widgets.grampletpane import (AVAILABLE_GRAMPLETS, +from .managedwindow import ManagedWindow +from .display import display_help, display_url +from .widgets.grampletpane import (AVAILABLE_GRAMPLETS, GET_AVAILABLE_GRAMPLETS, GET_GRAMPLET_LIST, get_gramplet_opts, get_gramplet_options_by_name, make_requested_gramplet, GuiGramplet) -from gramps.gui.widgets.undoablebuffer import UndoableBuffer -from gramps.gui.utils import is_right_click -from gramps.gui.dialog import QuestionDialog +from .widgets.undoablebuffer import UndoableBuffer +from .utils import is_right_click +from .dialog import QuestionDialog #------------------------------------------------------------------------- # diff --git a/gramps/gui/grampsgui.py b/gramps/gui/grampsgui.py index 98ca2387e..9f3f6c81b 100644 --- a/gramps/gui/grampsgui.py +++ b/gramps/gui/grampsgui.py @@ -88,7 +88,7 @@ def register_stock_icons (): Add the gramps names for its icons (eg gramps-person) to the GTK icon factory. This allows all gramps modules to call up the icons by their name """ - from gramps.gui.pluginmanager import base_reg_stock_icons + from .pluginmanager import base_reg_stock_icons #iconpath to the base image. The front of the list has highest priority if win(): @@ -186,7 +186,7 @@ def _display_welcome_message(): Display a welcome message to the user. """ if not config.get('behavior.betawarn'): - from gramps.gui.dialog import WarningDialog + from .dialog import WarningDialog WarningDialog( _('Danger: This is unstable code!'), _("This Gramps 3.x-trunk is a development release. " @@ -226,7 +226,7 @@ class Gramps(object): import viewmanager from viewmanager import ViewManager from gramps.cli.arghandler import ArgHandler - from gramps.gui.tipofday import TipOfDay + from .tipofday import TipOfDay register_stock_icons() @@ -259,7 +259,7 @@ class Gramps(object): TipOfDay(self.vm.uistate) def argerrorfunc(self, string): - from gramps.gui.dialog import ErrorDialog + from .dialog import ErrorDialog """ Show basic errors in argument handling in GUI fashion""" ErrorDialog(_("Error parsing arguments"), string) @@ -274,7 +274,7 @@ def __startgramps(errors, argparser): Main startup function started via GObject.timeout_add First action inside the gtk loop """ - from gramps.gui.dialog import ErrorDialog + from .dialog import ErrorDialog #handle first existing errors in GUI fashion if errors: ErrorDialog(errors[0], errors[1]) @@ -287,7 +287,7 @@ def __startgramps(errors, argparser): sys.exit(1) # add gui logger - from gramps.gui.logger import RotateHandler, GtkHandler + from .logger import RotateHandler, GtkHandler form = logging.Formatter(fmt="%(relativeCreated)d: %(levelname)s: " "%(filename)s: line %(lineno)d: %(message)s") # Create the log handlers diff --git a/gramps/gui/makefilter.py b/gramps/gui/makefilter.py index 0ed179dc9..fa771c37a 100644 --- a/gramps/gui/makefilter.py +++ b/gramps/gui/makefilter.py @@ -21,7 +21,7 @@ # $Id$ import time -from gramps.gui.editors import EditFilter +from .editors import EditFilter from gramps.gen.const import CUSTOM_FILTERS from gramps.gen.filters import (rules, FilterList, GenericFilterFactory, reload_custom_filters) diff --git a/gramps/gui/managedwindow.py b/gramps/gui/managedwindow.py index 6d88287d0..1a56cd669 100644 --- a/gramps/gui/managedwindow.py +++ b/gramps/gui/managedwindow.py @@ -49,7 +49,7 @@ from gi.repository import Gtk from gramps.gen.const import GLADE_FILE, ICON from gramps.gen.errors import WindowActiveError from gramps.gen.config import config -from gramps.gui.glade import Glade +from .glade import Glade #------------------------------------------------------------------------- # @@ -321,7 +321,7 @@ class ManagedWindow(object): The usage from derived classes is envisioned as follows: - from gramps.gui.managedwindow import ManagedWindow + from .managedwindow import ManagedWindow class SomeWindowClass(ManagedWindow): def __init__(self,uistate,dbstate,track): window_id = self # Or e.g. window_id = person.handle diff --git a/gramps/gui/tipofday.py b/gramps/gui/tipofday.py index b79eb38a5..195f091b7 100644 --- a/gramps/gui/tipofday.py +++ b/gramps/gui/tipofday.py @@ -47,9 +47,9 @@ import os #------------------------------------------------------------------------- from gramps.gen.const import IMAGE_DIR, TIP_DATA from gramps.gen.config import config -from gramps.gui.managedwindow import ManagedWindow -from gramps.gui.dialog import ErrorDialog -from gramps.gui.glade import Glade +from .managedwindow import ManagedWindow +from .dialog import ErrorDialog +from .glade import Glade #------------------------------------------------------------------------- # diff --git a/gramps/gui/undohistory.py b/gramps/gui/undohistory.py index 14c780e11..be5296b74 100644 --- a/gramps/gui/undohistory.py +++ b/gramps/gui/undohistory.py @@ -44,8 +44,8 @@ from gi.repository import GObject # GRAMPS modules # #------------------------------------------------------------------------- -from gramps.gui.dialog import QuestionDialog -from gramps.gui.managedwindow import ManagedWindow +from .dialog import QuestionDialog +from .managedwindow import ManagedWindow #------------------------------------------------------------------------- # diff --git a/gramps/gui/user.py b/gramps/gui/user.py index baa04f6b3..30fbac631 100644 --- a/gramps/gui/user.py +++ b/gramps/gui/user.py @@ -37,8 +37,8 @@ import sys # #------------------------------------------------------------------------- from gramps.gen.user import User -from gramps.gui.utils import ProgressMeter -from gramps.gui.dialog import (WarningDialog, ErrorDialog, DBErrorDialog, +from .utils import ProgressMeter +from .dialog import (WarningDialog, ErrorDialog, DBErrorDialog, InfoDialog) #------------------------------------------------------------------------- # diff --git a/gramps/gui/utils.py b/gramps/gui/utils.py index 0e961f281..7f84f0443 100644 --- a/gramps/gui/utils.py +++ b/gramps/gui/utils.py @@ -285,7 +285,7 @@ class ProgressMeter(object): """ Don't let the user close the progress dialog. """ - from gramps.gui.dialog import WarningDialog + from .dialog import WarningDialog WarningDialog( _("Attempt to force closing the dialog"), _("Please do not force closing this important dialog."), @@ -355,7 +355,7 @@ def open_file_with_default_application( file_path ): @type file_path: string @return: nothing """ - from gramps.gui.dialog import ErrorDialog + from .dialog import ErrorDialog norm_path = os.path.normpath( file_path ) if not os.path.exists(norm_path): diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 755c320b7..cc6ca6fb9 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -66,38 +66,38 @@ from gi.repository import Gtk # #------------------------------------------------------------------------- from gramps.cli.grampscli import CLIManager -from gramps.gui.user import User -from gramps.gui.plug import tool +from .user import User +from .plug import tool from gramps.gen.plug import (START, END) from gramps.gen.plug import REPORT from gramps.gen.plug.report._constants import standalone_categories -from gramps.gui.plug import (PluginWindows, ReportPluginDialog, ToolPluginDialog) -from gramps.gui.plug.report import report +from .plug import (PluginWindows, ReportPluginDialog, ToolPluginDialog) +from .plug.report import report from gramps.gen.plug.utils import version_str_to_tup, load_addon_file -from gramps.gui.pluginmanager import GuiPluginManager +from .pluginmanager import GuiPluginManager from gramps.gen.relationship import get_relationship_calculator -from gramps.gui.displaystate import DisplayState, RecentDocsMenu +from .displaystate import DisplayState, RecentDocsMenu from gramps.gen.const import (HOME_DIR, ICON, URL_BUGTRACKER, URL_HOMEPAGE, URL_MAILINGLIST, URL_MANUAL_PAGE, URL_WIKISTRING, WIKI_EXTRAPLUGINS) from gramps.gen.constfunc import is_quartz from gramps.gen.config import config from gramps.gen.errors import WindowActiveError -from gramps.gui.dialog import (ErrorDialog, WarningDialog, QuestionDialog2, +from .dialog import (ErrorDialog, WarningDialog, QuestionDialog2, InfoDialog) -from gramps.gui import widgets -from gramps.gui.undohistory import UndoHistory +from . import widgets +from .undohistory import UndoHistory from gramps.gen.utils.file import (media_path_full, get_unicode_path_from_env_var, get_unicode_path_from_file_chooser) -from gramps.gui.dbloader import DbLoader -from gramps.gui.display import display_help, display_url -from gramps.gui.widgets.progressdialog import ProgressMonitor, GtkProgressDialog -from gramps.gui.configure import GrampsPreferences +from .dbloader import DbLoader +from .display import display_help, display_url +from .widgets.progressdialog import ProgressMonitor, GtkProgressDialog +from .configure import GrampsPreferences from gramps.gen.db.backup import backup from gramps.gen.db.exceptions import DbException -from gramps.gui.aboutdialog import GrampsAboutDialog -from gramps.gui.navigator import Navigator -from gramps.gui.views.tags import Tags +from .aboutdialog import GrampsAboutDialog +from .navigator import Navigator +from .views.tags import Tags from gramps.gen.utils.configmanager import safe_eval #------------------------------------------------------------------------- @@ -435,16 +435,16 @@ class ViewManager(CLIManager): if addon_update_list: self.update_addons(addon_update_list) elif force: - from gramps.gui.dialog import OkDialog + from .dialog import OkDialog OkDialog(_("There are no available addons of this type"), _("Checked for '%s'") % _("' and '").join([_(t) for t in config.get('behavior.check-for-update-types')]), self.window) def update_addons(self, addon_update_list): - from gramps.gui.glade import Glade - from gramps.gui.managedwindow import set_titles - from gramps.gui.listmodel import ListModel, NOSORT, TOGGLE + from .glade import Glade + from .managedwindow import set_titles + from .listmodel import ListModel, NOSORT, TOGGLE glade = Glade("updateaddons.glade") self.update_dialog = glade.toplevel set_titles(self.update_dialog, glade.get_object('title'), @@ -521,8 +521,8 @@ class ViewManager(CLIManager): """ Process all of the selected addons. """ - from gramps.gui.dialog import OkDialog - from gramps.gui.widgets.progressdialog import LongOpStatus + from .dialog import OkDialog + from .widgets.progressdialog import LongOpStatus self.update_dialog.hide() model = self.list.model @@ -1112,7 +1112,7 @@ class ViewManager(CLIManager): """ Display Tip of the day """ - from gramps.gui.tipofday import TipOfDay + from .tipofday import TipOfDay TipOfDay(self.uistate) def __plugin_status(self, obj=None, data=None): @@ -1200,7 +1200,7 @@ class ViewManager(CLIManager): return None def __create_dummy_page(self, pdata, error): - from gramps.gui.views.pageview import DummyPage + from .views.pageview import DummyPage return DummyPage(pdata.name, pdata, self.dbstate, self.uistate, _("View failed to load. Check error output."), error) @@ -1472,7 +1472,7 @@ class ViewManager(CLIManager): """ Make a quick XML back with or without media. """ - from gramps.gui.dialog import QuestionDialog2 + from .dialog import QuestionDialog2 window = Gtk.Dialog(_("Gramps XML Backup"), self.uistate.window, Gtk.DialogFlags.DESTROY_WITH_PARENT, None) @@ -1663,7 +1663,7 @@ class ViewManager(CLIManager): """ Displays the Clipboard """ - from gramps.gui.clipboard import ClipboardWindow + from .clipboard import ClipboardWindow try: ClipboardWindow(self.dbstate, self.uistate) except WindowActiveError: @@ -1705,7 +1705,7 @@ class ViewManager(CLIManager): Calls the ExportAssistant to export data """ if self.dbstate.db.db_is_open: - from gramps.gui.plug.export import ExportAssistant + from .plug.export import ExportAssistant try: ExportAssistant(self.dbstate, self.uistate) except WindowActiveError: