From 1ac34dfeb97aea1cddf535ff699561be390508f9 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Thu, 7 Jun 2012 16:08:40 +0000 Subject: [PATCH] GEPS008: Moved DbState module svn: r19784 --- src/ExportOptions.py | 2 +- src/Makefile.am | 1 - src/cli/grampscli.py | 4 ++-- src/cli/plug/__init__.py | 4 ++-- src/gen/Makefile.am | 1 + src/{DbState.py => gen/dbstate.py} | 0 src/gui/grampsgui.py | 4 ++-- src/guiQML/grampsqml.py | 4 ++-- src/webapp/reports.py | 6 +++--- src/webapp/utils.py | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) rename src/{DbState.py => gen/dbstate.py} (100%) diff --git a/src/ExportOptions.py b/src/ExportOptions.py index 37be1c001..df88ff2ac 100644 --- a/src/ExportOptions.py +++ b/src/ExportOptions.py @@ -216,7 +216,7 @@ class WriterOptionBox(object): return widget def show_preview_data(self, widget): - from DbState import DbState + from gen.dbstate import DbState from gui.plug.quick import run_quick_report_by_name if widget.proxy_name == "unfiltered": dbstate = self.dbstate diff --git a/src/Makefile.am b/src/Makefile.am index 5ec834a75..f5f668ff8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,7 +18,6 @@ gdir_PYTHON = \ const.py\ constfunc.py\ DateEdit.py\ - DbState.py\ Errors.py\ ExportAssistant.py\ ExportOptions.py\ diff --git a/src/cli/grampscli.py b/src/cli/grampscli.py index 274a16ac5..da62d7e25 100644 --- a/src/cli/grampscli.py +++ b/src/cli/grampscli.py @@ -49,7 +49,7 @@ from gen.display.name import displayer as name_displayer import config import const import Errors -import DbState +from gen.dbstate import DbState from gen.db import DbBsddb import gen.db.exceptions from gen.plug import BasePluginManager @@ -313,7 +313,7 @@ def startcli(errors, argparser): sys.exit(1) #we need to keep track of the db state - dbstate = DbState.DbState() + dbstate = DbState() #we need a manager for the CLI session climanager = CLIManager(dbstate, True) #load the plugins diff --git a/src/cli/plug/__init__.py b/src/cli/plug/__init__.py index 715446d04..fbf6e9b89 100644 --- a/src/cli/plug/__init__.py +++ b/src/cli/plug/__init__.py @@ -60,7 +60,7 @@ from gen.plug.report import (CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK, CATEGORY_GRAPHVIZ, CATEGORY_CODE) from gen.plug.report._paper import paper_sizes import const -import DbState +from gen.dbstate import DbState from cli.grampscli import CLIManager import cli.user @@ -627,7 +627,7 @@ def run_report(db, name, **options_str_dict): options and values used in clr.option_class.options_dict filename in clr.option_class.get_output() """ - dbstate = DbState.DbState() + dbstate = DbState() climanager = CLIManager(dbstate, False) # don't load db climanager.do_reg_plugins(dbstate, None) pmgr = BasePluginManager.get_instance() diff --git a/src/gen/Makefile.am b/src/gen/Makefile.am index 6506e7d02..ddc7f3953 100644 --- a/src/gen/Makefile.am +++ b/src/gen/Makefile.am @@ -22,6 +22,7 @@ pkgpythondir = $(datadir)/@PACKAGE@/gen pkgpython_PYTHON = \ __init__.py \ + dbstate.py \ ggettext.py \ updatecallback.py \ user.py diff --git a/src/DbState.py b/src/gen/dbstate.py similarity index 100% rename from src/DbState.py rename to src/gen/dbstate.py diff --git a/src/gui/grampsgui.py b/src/gui/grampsgui.py index b144ada9e..ca8308445 100644 --- a/src/gui/grampsgui.py +++ b/src/gui/grampsgui.py @@ -205,14 +205,14 @@ class Gramps(object): """ def __init__(self, argparser): - import DbState + from gen.dbstate import DbState from viewmanager import ViewManager from cli.arghandler import ArgHandler from gui.tipofday import TipOfDay register_stock_icons() - dbstate = DbState.DbState() + dbstate = DbState() self.vm = ViewManager(dbstate, config.get("interface.view-categories")) self.vm.init_interface() diff --git a/src/guiQML/grampsqml.py b/src/guiQML/grampsqml.py index d8e866fa5..d8bf2095d 100644 --- a/src/guiQML/grampsqml.py +++ b/src/guiQML/grampsqml.py @@ -60,13 +60,13 @@ class GrampsQML(object): """ def __init__(self, argparser): - import DbState + from gen.dbstate import DbState from guiQML.viewmanager import ViewManager from cli.arghandler import ArgHandler from PySide import QtGui self.app = QtGui.QApplication(sys.argv) - dbstate = DbState.DbState() + dbstate = DbState() self.vm = ViewManager(dbstate) #act based on the given arguments diff --git a/src/webapp/reports.py b/src/webapp/reports.py index 188b82689..f20ec9b12 100644 --- a/src/webapp/reports.py +++ b/src/webapp/reports.py @@ -23,7 +23,7 @@ # imports for import/export: -import DbState +from gen.dbstate import DbState from cli.grampscli import CLIManager from gen.plug import BasePluginManager import os @@ -48,7 +48,7 @@ def import_file(db, filename, user): >>> import_file(DbDjango(), "/home/user/Untitled_1.ged", User()) """ from grampsdb.models import Person - dbstate = DbState.DbState() + dbstate = DbState() climanager = CLIManager(dbstate, False) # do not load db_loader climanager.do_reg_plugins(dbstate, None) pmgr = BasePluginManager.get_instance() @@ -108,7 +108,7 @@ def export_file(db, filename, user): >>> export_file(DbDjango(), "/home/user/Untitled_1.ged", User()) """ - dbstate = DbState.DbState() + dbstate = DbState() climanager = CLIManager(dbstate, False) # do not load db_loader climanager.do_reg_plugins(dbstate, None) pmgr = BasePluginManager.get_instance() diff --git a/src/webapp/utils.py b/src/webapp/utils.py index 59da6da1e..35161784f 100644 --- a/src/webapp/utils.py +++ b/src/webapp/utils.py @@ -58,7 +58,7 @@ from webapp.dbdjango import DbDjango #------------------------------------------------------------------------ from gen.simple import SimpleTable, SimpleAccess, make_basic_stylesheet import Utils -import DbState +from gen.dbstate import DbState from gen.datehandler import displayer, parser from gen.lib.date import Date as GDate, Today import gen.lib @@ -118,7 +118,7 @@ dp = parser.parse db = DbDjango() def register_plugins(): - dbstate = DbState.DbState() + dbstate = DbState() climanager = CLIManager(dbstate, False) # don't load db climanager.do_reg_plugins(dbstate, None) pmgr = BasePluginManager.get_instance()