GEPS008: Moved DbState module

svn: r19784
This commit is contained in:
Nick Hall 2012-06-07 16:08:40 +00:00
parent 31bf96496b
commit 1ac34dfeb9
10 changed files with 15 additions and 15 deletions

View File

@ -216,7 +216,7 @@ class WriterOptionBox(object):
return widget return widget
def show_preview_data(self, 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 from gui.plug.quick import run_quick_report_by_name
if widget.proxy_name == "unfiltered": if widget.proxy_name == "unfiltered":
dbstate = self.dbstate dbstate = self.dbstate

View File

@ -18,7 +18,6 @@ gdir_PYTHON = \
const.py\ const.py\
constfunc.py\ constfunc.py\
DateEdit.py\ DateEdit.py\
DbState.py\
Errors.py\ Errors.py\
ExportAssistant.py\ ExportAssistant.py\
ExportOptions.py\ ExportOptions.py\

View File

@ -49,7 +49,7 @@ from gen.display.name import displayer as name_displayer
import config import config
import const import const
import Errors import Errors
import DbState from gen.dbstate import DbState
from gen.db import DbBsddb from gen.db import DbBsddb
import gen.db.exceptions import gen.db.exceptions
from gen.plug import BasePluginManager from gen.plug import BasePluginManager
@ -313,7 +313,7 @@ def startcli(errors, argparser):
sys.exit(1) sys.exit(1)
#we need to keep track of the db state #we need to keep track of the db state
dbstate = DbState.DbState() dbstate = DbState()
#we need a manager for the CLI session #we need a manager for the CLI session
climanager = CLIManager(dbstate, True) climanager = CLIManager(dbstate, True)
#load the plugins #load the plugins

View File

@ -60,7 +60,7 @@ from gen.plug.report import (CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK,
CATEGORY_GRAPHVIZ, CATEGORY_CODE) CATEGORY_GRAPHVIZ, CATEGORY_CODE)
from gen.plug.report._paper import paper_sizes from gen.plug.report._paper import paper_sizes
import const import const
import DbState from gen.dbstate import DbState
from cli.grampscli import CLIManager from cli.grampscli import CLIManager
import cli.user 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 options and values used in clr.option_class.options_dict
filename in clr.option_class.get_output() filename in clr.option_class.get_output()
""" """
dbstate = DbState.DbState() dbstate = DbState()
climanager = CLIManager(dbstate, False) # don't load db climanager = CLIManager(dbstate, False) # don't load db
climanager.do_reg_plugins(dbstate, None) climanager.do_reg_plugins(dbstate, None)
pmgr = BasePluginManager.get_instance() pmgr = BasePluginManager.get_instance()

View File

@ -22,6 +22,7 @@ pkgpythondir = $(datadir)/@PACKAGE@/gen
pkgpython_PYTHON = \ pkgpython_PYTHON = \
__init__.py \ __init__.py \
dbstate.py \
ggettext.py \ ggettext.py \
updatecallback.py \ updatecallback.py \
user.py user.py

View File

@ -205,14 +205,14 @@ class Gramps(object):
""" """
def __init__(self, argparser): def __init__(self, argparser):
import DbState from gen.dbstate import DbState
from viewmanager import ViewManager from viewmanager import ViewManager
from cli.arghandler import ArgHandler from cli.arghandler import ArgHandler
from gui.tipofday import TipOfDay from gui.tipofday import TipOfDay
register_stock_icons() register_stock_icons()
dbstate = DbState.DbState() dbstate = DbState()
self.vm = ViewManager(dbstate, config.get("interface.view-categories")) self.vm = ViewManager(dbstate, config.get("interface.view-categories"))
self.vm.init_interface() self.vm.init_interface()

View File

@ -60,13 +60,13 @@ class GrampsQML(object):
""" """
def __init__(self, argparser): def __init__(self, argparser):
import DbState from gen.dbstate import DbState
from guiQML.viewmanager import ViewManager from guiQML.viewmanager import ViewManager
from cli.arghandler import ArgHandler from cli.arghandler import ArgHandler
from PySide import QtGui from PySide import QtGui
self.app = QtGui.QApplication(sys.argv) self.app = QtGui.QApplication(sys.argv)
dbstate = DbState.DbState() dbstate = DbState()
self.vm = ViewManager(dbstate) self.vm = ViewManager(dbstate)
#act based on the given arguments #act based on the given arguments

View File

@ -23,7 +23,7 @@
# imports for import/export: # imports for import/export:
import DbState from gen.dbstate import DbState
from cli.grampscli import CLIManager from cli.grampscli import CLIManager
from gen.plug import BasePluginManager from gen.plug import BasePluginManager
import os import os
@ -48,7 +48,7 @@ def import_file(db, filename, user):
>>> import_file(DbDjango(), "/home/user/Untitled_1.ged", User()) >>> import_file(DbDjango(), "/home/user/Untitled_1.ged", User())
""" """
from grampsdb.models import Person from grampsdb.models import Person
dbstate = DbState.DbState() dbstate = DbState()
climanager = CLIManager(dbstate, False) # do not load db_loader climanager = CLIManager(dbstate, False) # do not load db_loader
climanager.do_reg_plugins(dbstate, None) climanager.do_reg_plugins(dbstate, None)
pmgr = BasePluginManager.get_instance() pmgr = BasePluginManager.get_instance()
@ -108,7 +108,7 @@ def export_file(db, filename, user):
>>> export_file(DbDjango(), "/home/user/Untitled_1.ged", 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 = CLIManager(dbstate, False) # do not load db_loader
climanager.do_reg_plugins(dbstate, None) climanager.do_reg_plugins(dbstate, None)
pmgr = BasePluginManager.get_instance() pmgr = BasePluginManager.get_instance()

View File

@ -58,7 +58,7 @@ from webapp.dbdjango import DbDjango
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from gen.simple import SimpleTable, SimpleAccess, make_basic_stylesheet from gen.simple import SimpleTable, SimpleAccess, make_basic_stylesheet
import Utils import Utils
import DbState from gen.dbstate import DbState
from gen.datehandler import displayer, parser from gen.datehandler import displayer, parser
from gen.lib.date import Date as GDate, Today from gen.lib.date import Date as GDate, Today
import gen.lib import gen.lib
@ -118,7 +118,7 @@ dp = parser.parse
db = DbDjango() db = DbDjango()
def register_plugins(): def register_plugins():
dbstate = DbState.DbState() dbstate = DbState()
climanager = CLIManager(dbstate, False) # don't load db climanager = CLIManager(dbstate, False) # don't load db
climanager.do_reg_plugins(dbstate, None) climanager.do_reg_plugins(dbstate, None)
pmgr = BasePluginManager.get_instance() pmgr = BasePluginManager.get_instance()