From b3509ad3f4064761aaa2a4988cf8631763df7d34 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Wed, 22 Feb 2017 17:16:04 +0000 Subject: [PATCH] Convert some gui imports from absolute to relative --- gramps/gui/dbman.py | 4 ++-- gramps/gui/dialog.py | 4 ++-- gramps/gui/display.py | 2 +- gramps/gui/editors/test/test_editreference.py | 2 +- gramps/gui/listmodel.py | 2 +- gramps/gui/plug/quick/_quicktable.py | 2 +- gramps/gui/plug/report/_reportdialog.py | 2 +- gramps/gui/selectors/selectcitation.py | 2 +- gramps/gui/selectors/selectevent.py | 2 +- gramps/gui/selectors/selectfamily.py | 2 +- gramps/gui/selectors/selectnote.py | 2 +- gramps/gui/selectors/selectobject.py | 2 +- gramps/gui/selectors/selectperson.py | 2 +- gramps/gui/selectors/selectplace.py | 2 +- gramps/gui/selectors/selectrepository.py | 2 +- gramps/gui/selectors/selectsource.py | 2 +- gramps/gui/views/bookmarks.py | 2 +- gramps/gui/widgets/fanchart.py | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) diff --git a/gramps/gui/dbman.py b/gramps/gui/dbman.py index 5c5516b30..a6d917fee 100644 --- a/gramps/gui/dbman.py +++ b/gramps/gui/dbman.py @@ -52,7 +52,7 @@ from gi.repository import Pango # gramps modules # #------------------------------------------------------------------------- -from gramps.gui.display import display_help +from .display import display_help from gramps.gen.const import URL_WIKISTRING, URL_MANUAL_PAGE from .user import User from .dialog import ErrorDialog, QuestionDialog, QuestionDialog2, ICON @@ -65,7 +65,7 @@ from .glade import Glade from gramps.gen.db.exceptions import DbException from gramps.gen.db.utils import make_database, open_database from gramps.gen.config import config -from gramps.gui.listmodel import ListModel +from .listmodel import ListModel from gramps.gen.constfunc import win from gramps.gen.plug import BasePluginManager from gramps.gen.const import GRAMPS_LOCALE as glocale diff --git a/gramps/gui/dialog.py b/gramps/gui/dialog.py index b48a34fce..7cec7247b 100644 --- a/gramps/gui/dialog.py +++ b/gramps/gui/dialog.py @@ -45,7 +45,8 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext from gramps.gen.const import ICON, URL_BUGHOME from gramps.gen.config import config -from gramps.gui.glade import Glade +from .glade import Glade +from .display import display_url try: ICON = GdkPixbuf.Pixbuf.new_from_file(ICON) @@ -119,7 +120,6 @@ class QuestionDialog: if response == Gtk.ResponseType.ACCEPT: task() -from gramps.gui.display import display_url def on_activate_link(label, uri): # see aboutdialog.py _show_url() display_url(uri) diff --git a/gramps/gui/display.py b/gramps/gui/display.py index bea1a09d4..ae61995b4 100644 --- a/gramps/gui/display.py +++ b/gramps/gui/display.py @@ -35,7 +35,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale from gramps.gen.const import URL_MANUAL_PAGE, URL_WIKISTRING from gramps.gen.constfunc import is_quartz from gramps.gen.config import config -from gramps.gui.utils import open_file_with_default_application as run_file +from .utils import open_file_with_default_application as run_file #list of manuals on wiki, map locale code to wiki extension, add language codes #completely, or first part, so pt_BR if Brazilian portugeze wiki manual, and diff --git a/gramps/gui/editors/test/test_editreference.py b/gramps/gui/editors/test/test_editreference.py index 260e416a2..ddfd1778b 100644 --- a/gramps/gui/editors/test/test_editreference.py +++ b/gramps/gui/editors/test/test_editreference.py @@ -37,7 +37,7 @@ from gramps.gen.lib import (Person, Family, Event, Source, Place, Citation, from gramps.cli.user import User from gramps.gen.dbstate import DbState from gramps.gen.db.utils import make_database -from gramps.gui.editors.editreference import EditReference +from ..editreference import EditReference class MockWindow: def set_transient_for(self, *args, **kwargs): diff --git a/gramps/gui/listmodel.py b/gramps/gui/listmodel.py index e70c72d37..9f4643284 100644 --- a/gramps/gui/listmodel.py +++ b/gramps/gui/listmodel.py @@ -480,7 +480,7 @@ class ListModel: """ Called when a button press is executed """ - from gramps.gui.utils import is_right_click + from .utils import is_right_click if event.type == Gdk.EventType._2BUTTON_PRESS and event.button == 1: if self.double_click: self.double_click(obj) diff --git a/gramps/gui/plug/quick/_quicktable.py b/gramps/gui/plug/quick/_quicktable.py index 1070b4628..1f282c184 100644 --- a/gramps/gui/plug/quick/_quicktable.py +++ b/gramps/gui/plug/quick/_quicktable.py @@ -48,7 +48,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext from gramps.gen.simple import SimpleTable from gramps.gen.errors import WindowActiveError -from gramps.gui.utils import model_to_text, text_to_clipboard +from ...utils import model_to_text, text_to_clipboard from ...widgets.multitreeview import MultiTreeView from ...ddtargets import DdTargets from ..quick import run_quick_report_by_name diff --git a/gramps/gui/plug/report/_reportdialog.py b/gramps/gui/plug/report/_reportdialog.py index b0a5fe965..e52e4edf0 100644 --- a/gramps/gui/plug/report/_reportdialog.py +++ b/gramps/gui/plug/report/_reportdialog.py @@ -382,7 +382,7 @@ class ReportDialog(ManagedWindow): row += 1 def setup_other_frames(self): - from gramps.gui.plug._guioptions import GuiTextOption + from .._guioptions import GuiTextOption for key in self.frame_names: flist = self.frames[key] grid = Gtk.Grid() diff --git a/gramps/gui/selectors/selectcitation.py b/gramps/gui/selectors/selectcitation.py index d8faaa015..60c2e7080 100644 --- a/gramps/gui/selectors/selectcitation.py +++ b/gramps/gui/selectors/selectcitation.py @@ -39,7 +39,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext from ..views.treemodels import CitationTreeModel from .baseselector import BaseSelector -from gramps.gui.display import display_help +from ..display import display_help from gramps.gen.const import URL_MANUAL_SECT2 #------------------------------------------------------------------------- diff --git a/gramps/gui/selectors/selectevent.py b/gramps/gui/selectors/selectevent.py index 31b61f487..e842d7366 100644 --- a/gramps/gui/selectors/selectevent.py +++ b/gramps/gui/selectors/selectevent.py @@ -34,7 +34,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext from ..views.treemodels import EventModel from .baseselector import BaseSelector -from gramps.gui.display import display_help +from ..display import display_help from gramps.gen.const import URL_MANUAL_SECT1 #------------------------------------------------------------------------- diff --git a/gramps/gui/selectors/selectfamily.py b/gramps/gui/selectors/selectfamily.py index f5c7c4969..b9d18204a 100644 --- a/gramps/gui/selectors/selectfamily.py +++ b/gramps/gui/selectors/selectfamily.py @@ -34,7 +34,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext from ..views.treemodels import FamilyModel from .baseselector import BaseSelector -from gramps.gui.display import display_help +from ..display import display_help from gramps.gen.const import URL_MANUAL_PAGE #------------------------------------------------------------------------- diff --git a/gramps/gui/selectors/selectnote.py b/gramps/gui/selectors/selectnote.py index 5cd8773f7..d1a7dd800 100644 --- a/gramps/gui/selectors/selectnote.py +++ b/gramps/gui/selectors/selectnote.py @@ -37,7 +37,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext from ..views.treemodels import NoteModel from .baseselector import BaseSelector -from gramps.gui.display import display_help +from ..display import display_help from gramps.gen.const import URL_MANUAL_SECT1 #------------------------------------------------------------------------- diff --git a/gramps/gui/selectors/selectobject.py b/gramps/gui/selectors/selectobject.py index af8d4c093..5f726c2dd 100644 --- a/gramps/gui/selectors/selectobject.py +++ b/gramps/gui/selectors/selectobject.py @@ -48,7 +48,7 @@ from gramps.gen.utils.file import media_path_full from gramps.gen.utils.thumbnails import get_thumbnail_image from ..views.treemodels import MediaModel from .baseselector import BaseSelector -from gramps.gui.display import display_help +from ..display import display_help from gramps.gen.const import URL_MANUAL_SECT1 #------------------------------------------------------------------------- diff --git a/gramps/gui/selectors/selectperson.py b/gramps/gui/selectors/selectperson.py index e8249d9b8..9d7525f72 100644 --- a/gramps/gui/selectors/selectperson.py +++ b/gramps/gui/selectors/selectperson.py @@ -36,7 +36,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext from ..views.treemodels import PeopleBaseModel, PersonTreeModel from .baseselector import BaseSelector -from gramps.gui.display import display_help +from ..display import display_help from gramps.gen.const import URL_MANUAL_SECT1 #------------------------------------------------------------------------- diff --git a/gramps/gui/selectors/selectplace.py b/gramps/gui/selectors/selectplace.py index 011c95450..e4c4103d8 100644 --- a/gramps/gui/selectors/selectplace.py +++ b/gramps/gui/selectors/selectplace.py @@ -35,7 +35,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext from ..views.treemodels.placemodel import PlaceTreeModel from .baseselector import BaseSelector -from gramps.gui.display import display_help +from ..display import display_help from gramps.gen.const import URL_MANUAL_SECT2 #------------------------------------------------------------------------- diff --git a/gramps/gui/selectors/selectrepository.py b/gramps/gui/selectors/selectrepository.py index a5286ae48..8044e918d 100644 --- a/gramps/gui/selectors/selectrepository.py +++ b/gramps/gui/selectors/selectrepository.py @@ -34,7 +34,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext from ..views.treemodels import RepositoryModel from .baseselector import BaseSelector -from gramps.gui.display import display_help +from ..display import display_help from gramps.gen.const import URL_MANUAL_SECT2 #------------------------------------------------------------------------- diff --git a/gramps/gui/selectors/selectsource.py b/gramps/gui/selectors/selectsource.py index 133093d3d..5b99e2eab 100644 --- a/gramps/gui/selectors/selectsource.py +++ b/gramps/gui/selectors/selectsource.py @@ -34,7 +34,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext from ..views.treemodels import SourceModel from .baseselector import BaseSelector -from gramps.gui.display import display_help +from ..display import display_help from gramps.gen.const import URL_MANUAL_PAGE #------------------------------------------------------------------------- diff --git a/gramps/gui/views/bookmarks.py b/gramps/gui/views/bookmarks.py index b45f54df7..b6ecbd613 100644 --- a/gramps/gui/views/bookmarks.py +++ b/gramps/gui/views/bookmarks.py @@ -455,7 +455,7 @@ class CitationBookmarks(ListBookmarks): # FIXME: See http://www.gramps-project.org/bugs/view.php?id=6352 a # more comprehensive solution is needed in the long term. See also # change_active in CitatinTreeView - from gramps.gui.dialog import WarningDialog + from ..dialog import WarningDialog WarningDialog( _("Cannot bookmark this reference"), # FIXME should this next string be translated? diff --git a/gramps/gui/widgets/fanchart.py b/gramps/gui/widgets/fanchart.py index 67abe69d1..259d87633 100644 --- a/gramps/gui/widgets/fanchart.py +++ b/gramps/gui/widgets/fanchart.py @@ -91,7 +91,7 @@ from gramps.gen.const import ( TYPE_BOX_NORMAL, TYPE_BOX_FAMILY) _ = glocale.translation.gettext -from gramps.gui.utilscairo import warpPath +from ..utilscairo import warpPath #------------------------------------------------------------------------- #