Convert plug to use relative imports

svn: r20505
This commit is contained in:
Nick Hall 2012-10-03 15:27:41 +00:00
parent c8f30e4c3e
commit 3a52f3afcb
15 changed files with 47 additions and 47 deletions

View File

@ -43,11 +43,11 @@ from collections import defaultdict
#-------------------------------------------------------------------------
from gramps.gen.const import PLUGINS_GLADE
from gramps.gen.plug.report._constants import standalone_categories
from gramps.gui.plug import tool
from . import tool
from gramps.gen.plug import REPORT
from gramps.gui.plug.report import report
from gramps.gui.pluginmanager import GuiPluginManager
from gramps.gui.managedwindow import ManagedWindow
from .report import report
from ..pluginmanager import GuiPluginManager
from ..managedwindow import ManagedWindow
#-------------------------------------------------------------------------
#

View File

@ -52,12 +52,12 @@ from gi.repository import GObject
#
#-------------------------------------------------------------------------
from gramps.gen.utils.file import get_unicode_path_from_file_chooser
from gramps.gui.utils import ProgressMeter
from gramps.gui.pluginmanager import GuiPluginManager
from gramps.gui import widgets
from gramps.gui.managedwindow import ManagedWindow
from gramps.gui.dialog import OptionDialog
from gramps.gui.selectors import SelectorFactory
from ..utils import ProgressMeter
from ..pluginmanager import GuiPluginManager
from .. import widgets
from ..managedwindow import ManagedWindow
from ..dialog import OptionDialog
from ..selectors import SelectorFactory
from gramps.gen.display.name import displayer as _nd
from gramps.gen.filters import GenericFilterFactory, GenericFilter, rules

View File

@ -47,16 +47,16 @@ from gi.repository import GObject
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gramps.gui.managedwindow import ManagedWindow
from ..managedwindow import ManagedWindow
from gramps.gen.errors import UnavailableError, WindowActiveError
from gramps.gen.plug import PluginRegister, PTYPE_STR, load_addon_file
from gramps.gen.ggettext import gettext as _
from gramps.gui.utils import open_file_with_default_application
from gramps.gui.pluginmanager import GuiPluginManager
from ..utils import open_file_with_default_application
from ..pluginmanager import GuiPluginManager
import tool
from _guioptions import add_gui_options
from gramps.gui.dialog import InfoDialog
from gramps.gui.editors import EditPerson
from ..dialog import InfoDialog
from ..editors import EditPerson
from gramps.gen.utils.file import get_unicode_path_from_file_chooser
from gramps.gen.const import URL_WIKISTRING, USER_HOME, WIKI_EXTRAPLUGINS_RAWDATA
from gramps.gen.config import config

View File

@ -60,12 +60,12 @@ from gi.repository import GdkPixbuf
from gramps.gen.const import USER_HOME, ICON, SPLASH
from gramps.gen.config import config
from gramps.gui.pluginmanager import GuiPluginManager
from ...pluginmanager import GuiPluginManager
from gramps.gen.utils.file import (find_folder, get_new_filename,
get_unicode_path_from_file_chooser)
from gramps.gui.managedwindow import ManagedWindow
from gramps.gui.dialog import ErrorDialog
from gramps.gui.user import User
from ...managedwindow import ManagedWindow
from ...dialog import ErrorDialog
from ...user import User
#-------------------------------------------------------------------------
#

View File

@ -40,7 +40,7 @@ from gramps.gen.ggettext import ngettext
from gramps.gen.config import config
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.filters import GenericFilter, rules
from gramps.gui.utils import ProgressMeter
from ...utils import ProgressMeter
from gramps.gen.proxy import (PrivateProxyDb,
LivingProxyDb,
FilterProxyDb,
@ -221,7 +221,7 @@ class WriterOptionBox(object):
def show_preview_data(self, widget):
from gramps.gen.dbstate import DbState
from gramps.gui.plug.quick import run_quick_report_by_name
from ..quick import run_quick_report_by_name
if widget.proxy_name == "unfiltered":
dbstate = self.dbstate
else:
@ -249,7 +249,7 @@ class WriterOptionBox(object):
"""
# Make a box and put the option in it:
from gi.repository import Gtk
from gramps.gui.widgets import SimpleButton
from ...widgets import SimpleButton
button = Gtk.Button(ngettext("%d Person", "%d People", 0) % 0)
button.set_size_request(107, -1)
button.connect("clicked", self.show_preview_data)
@ -622,7 +622,7 @@ class WriterOptionBox(object):
Callback which invokes the EditFilter dialog. Will create new
filter if called if none is selected.
"""
from gramps.gui.editors import EditFilter
from ...editors import EditFilter
from gramps.gen.filters import FilterList, GenericFilterFactory
from gramps.gen.const import CUSTOM_FILTERS
the_filter = None
@ -644,7 +644,7 @@ class WriterOptionBox(object):
the_filter, filterdb,
lambda : self.edit_filter_save(filterdb, namespace))
else: # can't edit this filter
from gramps.gui.dialog import ErrorDialog
from ...dialog import ErrorDialog
ErrorDialog(_("Cannot edit a system filter"),
_("Please select a different filter to edit"))

View File

@ -54,7 +54,7 @@ from gi.repository import Gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gramps.gui.pluginmanager import GuiPluginManager
from ...pluginmanager import GuiPluginManager
from gramps.gen.plug import (CATEGORY_QR_PERSON, CATEGORY_QR_FAMILY, CATEGORY_QR_MEDIA,
CATEGORY_QR_EVENT, CATEGORY_QR_SOURCE, CATEGORY_QR_MISC,
CATEGORY_QR_PLACE, CATEGORY_QR_REPOSITORY,

View File

@ -50,10 +50,10 @@ from gramps.gen.ggettext import sgettext as _
from gramps.gen.simple import SimpleTable
from gramps.gen.utils.trans import trans_objclass
from gramps.gen.errors import WindowActiveError
from gramps.gui.widgets.multitreeview import MultiTreeView
from gramps.gui.ddtargets import DdTargets
from gramps.gui.plug.quick import run_quick_report_by_name
from gramps.gui.editors import (EditPerson, EditEvent, EditFamily, EditCitation,
from ...widgets.multitreeview import MultiTreeView
from ...ddtargets import DdTargets
from ..quick import run_quick_report_by_name
from ...editors import (EditPerson, EditEvent, EditFamily, EditCitation,
EditSource, EditPlace, EditRepository, EditNote,
EditMedia)

View File

@ -38,7 +38,7 @@ from gi.repository import Pango, PangoCairo
from gramps.gen.plug.docgen import (BaseDoc, TextDoc, FONT_SERIF, PARA_ALIGN_RIGHT,
FONT_SANS_SERIF, FONT_MONOSPACE, PARA_ALIGN_CENTER,
PARA_ALIGN_LEFT)
from gramps.gui.managedwindow import ManagedWindow
from ...managedwindow import ManagedWindow
RESOLUTION = PangoCairo.font_map_get_default().get_resolution()

View File

@ -45,7 +45,7 @@ from gi.repository import Gtk
from gramps.gen.config import config
from _reportdialog import ReportDialog
from _papermenu import PaperFrame
from gramps.gui.pluginmanager import GuiPluginManager
from ...pluginmanager import GuiPluginManager
PLUGMAN = GuiPluginManager.get_instance()
#-------------------------------------------------------------------------

View File

@ -36,7 +36,7 @@ from gi.repository import GObject
#-------------------------------------------------------------------------
from gramps.gen.plug.report._constants import CATEGORY_DRAW
from _docreportdialog import DocReportDialog
from gramps.gui.pluginmanager import GuiPluginManager
from ...pluginmanager import GuiPluginManager
#-------------------------------------------------------------------------
#

View File

@ -43,7 +43,7 @@ from gi.repository import GObject
#-------------------------------------------------------------------------
from gramps.gen.plug.docgen import PaperStyle, PAPER_PORTRAIT, PAPER_LANDSCAPE
from gramps.gen.plug.report._paper import paper_sizes
from gramps.gui.glade import Glade
from ...glade import Glade
#-------------------------------------------------------------------------
#

View File

@ -51,15 +51,15 @@ from gi.repository import Gtk
from gramps.gen.ggettext import gettext as _
from gramps.gen.config import config
from gramps.gen.errors import DatabaseError, FilterError, ReportError, WindowActiveError
from gramps.gui.utils import open_file_with_default_application
from gramps.gui.plug import add_gui_options
from gramps.gui.user import User
from gramps.gui.dialog import ErrorDialog, OptionDialog
from ...utils import open_file_with_default_application
from .. import add_gui_options
from ...user import User
from ...dialog import ErrorDialog, OptionDialog
from gramps.gen.plug.report import (CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK,
CATEGORY_CODE, CATEGORY_WEB, CATEGORY_GRAPHVIZ,
standalone_categories)
from gramps.gen.plug.docgen import StyleSheet, StyleSheetList
from gramps.gui.managedwindow import ManagedWindow
from ...managedwindow import ManagedWindow
from _stylecombobox import StyleComboBox
from _styleeditor import StyleListDisplay
from _fileentry import FileEntry
@ -562,7 +562,7 @@ class ReportDialog(ManagedWindow):
pass
def on_help_clicked(self, *obj):
from gramps.gui.display import display_help
from ...display import display_help
display_help(URL_REPORT_PAGE, self.report_name.replace(" ", "_"))
def on_style_edit_clicked(self, *obj):

View File

@ -53,9 +53,9 @@ from gi.repository import Gdk
from gramps.gen.plug.docgen import (StyleSheet, FONT_SERIF, FONT_SANS_SERIF,
PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER, PARA_ALIGN_LEFT,
PARA_ALIGN_JUSTIFY)
from gramps.gui.listmodel import ListModel
from gramps.gui.managedwindow import set_titles
from gramps.gui.glade import Glade
from ...listmodel import ListModel
from ...managedwindow import set_titles
from ...glade import Glade
#------------------------------------------------------------------------
#
@ -134,7 +134,7 @@ class StyleListDisplay(object):
try:
self.sheetlist.save()
except IOError, msg:
from gramps.gui.dialog import ErrorDialog
from ...dialog import ErrorDialog
ErrorDialog(_("Error saving stylesheet"), str(msg))
except:
log.error("Failed to save stylesheet", exc_info=True)

View File

@ -35,7 +35,7 @@ from gi.repository import GObject
# GRAMPS modules
#
#-------------------------------------------------------------------------
from gramps.gui.pluginmanager import GuiPluginManager
from ...pluginmanager import GuiPluginManager
from gramps.gen.plug.report._constants import CATEGORY_TEXT
from _docreportdialog import DocReportDialog

View File

@ -74,7 +74,7 @@ class Tool(object):
"""
def __init__(self, dbstate, options_class, name):
from gramps.gui.plug import MenuToolOptions
from . import MenuToolOptions
self.db = dbstate.db
try:
if issubclass(options_class, MenuToolOptions):
@ -105,7 +105,7 @@ class BatchTool(Tool):
def __init__(self, dbstate, options_class, name):
# TODO: should we replace this with a callback?
from gramps.gui.dialog import QuestionDialog2
from ..dialog import QuestionDialog2
warn_dialog = QuestionDialog2(
_('Undo history warning'),
_('Proceeding with this tool will erase the undo history '
@ -134,7 +134,7 @@ class ActivePersonTool(Tool):
if not uistate.get_active('Person'):
# TODO: should we replace this with a callback?
from gramps.gui.dialog import ErrorDialog
from ..dialog import ErrorDialog
ErrorDialog(_('Active person has not been set'),
_('You must select an active person for this '