Continued work on GEP008: Move BasicUtils/UpdateCallback.py to gen/updatecallback.py.
svn: r14025
This commit is contained in:
parent
2a36355a8b
commit
252ef6daee
@ -53,6 +53,7 @@ src/cli/grampscli.py
|
||||
|
||||
# gen API
|
||||
src/gen/__init__.py
|
||||
src/gen/updatecallback.py
|
||||
|
||||
# gen utils API
|
||||
src/gen/utils/__init__.py
|
||||
@ -301,7 +302,6 @@ src/gui/widgets/validatedmaskedentry.py
|
||||
src/Simple/_SimpleTable.py
|
||||
|
||||
# BasicUtils package
|
||||
src/BasicUtils/_UpdateCallback.py
|
||||
src/BasicUtils/_NameDisplay.py
|
||||
|
||||
# Config package
|
||||
|
@ -6,7 +6,6 @@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/BasicUtils
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
_UpdateCallback.py\
|
||||
_NameDisplay.py\
|
||||
__init__.py
|
||||
|
||||
|
@ -20,5 +20,4 @@
|
||||
|
||||
# $Id: __init__.py$
|
||||
|
||||
from _UpdateCallback import UpdateCallback
|
||||
from _NameDisplay import displayer as name_displayer
|
||||
|
@ -13,7 +13,8 @@ SUBDIRS = \
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/gen
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
__init__.py
|
||||
__init__.py \
|
||||
updatecallback.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/gen
|
||||
pkgpythondir = @pkgpythondir@/gen
|
||||
|
@ -56,7 +56,7 @@ from gen.db import (DbBsddbRead, DbWriteBase, BSDDBTxn,
|
||||
DbUndoBSDDB as DbUndo)
|
||||
from gen.db.dbconst import *
|
||||
from gen.utils.callback import Callback
|
||||
from BasicUtils import UpdateCallback
|
||||
from gen.updatecallback import UpdateCallback
|
||||
import Errors
|
||||
|
||||
_LOG = logging.getLogger(DBLOGNAME)
|
||||
|
@ -44,7 +44,7 @@ import const
|
||||
import libgedcom
|
||||
import Errors
|
||||
from ExportOptions import WriterOptionBox
|
||||
import BasicUtils
|
||||
from gen.updatecallback import UpdateCallback
|
||||
from Utils import media_path_full
|
||||
import gen.proxy
|
||||
from QuestionDialog import ErrorDialog
|
||||
@ -202,16 +202,16 @@ def event_has_subordinate_data(event, event_ref):
|
||||
# GedcomWriter class
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class GedcomWriter(BasicUtils.UpdateCallback):
|
||||
class GedcomWriter(UpdateCallback):
|
||||
"""
|
||||
The GEDCOM writer creates a GEDCOM file that contains the exported
|
||||
information from the database. It derives from BasicUtils.UpdateCallback
|
||||
information from the database. It derives from UpdateCallback
|
||||
so that it can provide visual feedback via a progress bar if needed.
|
||||
"""
|
||||
|
||||
def __init__(self, database, cmd_line=0,
|
||||
option_box=None, callback=None):
|
||||
BasicUtils.UpdateCallback.__init__(self, callback)
|
||||
UpdateCallback.__init__(self, callback)
|
||||
|
||||
self.dbase = database
|
||||
self.cmd_line = cmd_line
|
||||
|
@ -59,7 +59,6 @@ import gtk
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ExportOptions import WriterOptionBox
|
||||
#from BasicUtils import UpdateCallback
|
||||
import gen.proxy
|
||||
from ExportXml import XmlWriter
|
||||
import Utils
|
||||
|
@ -56,7 +56,7 @@ log = logging.getLogger(".WriteXML")
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
from BasicUtils import UpdateCallback
|
||||
from gen.updatecallback import UpdateCallback
|
||||
from gen.db.exceptions import DbWriteFailure
|
||||
import const
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
@ -57,7 +57,7 @@ from gen.db.exceptions import DbVersionError
|
||||
import const
|
||||
from QuestionDialog import ErrorDialog
|
||||
from Errors import HandleError
|
||||
from BasicUtils import UpdateCallback
|
||||
from gen.updatecallback import UpdateCallback
|
||||
from BasicUtils import name_displayer
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -45,7 +45,7 @@ import DateHandler
|
||||
from BasicUtils import name_displayer
|
||||
from gen.db.dbconst import (PERSON_KEY, FAMILY_KEY, SOURCE_KEY, EVENT_KEY,
|
||||
MEDIA_KEY, PLACE_KEY, REPOSITORY_KEY, NOTE_KEY)
|
||||
from BasicUtils import UpdateCallback
|
||||
from gen.updatecallback import UpdateCallback
|
||||
import const
|
||||
import libgrampsxml
|
||||
from libmixin import DbMixin
|
||||
|
@ -111,7 +111,7 @@ LOG = logging.getLogger(".libgedcom")
|
||||
import Errors
|
||||
import const
|
||||
import gen.lib
|
||||
from BasicUtils import UpdateCallback
|
||||
from gen.updatecallback import UpdateCallback
|
||||
import Mime
|
||||
import LdsUtils
|
||||
import Utils
|
||||
|
@ -52,7 +52,7 @@ import GrampsDisplay
|
||||
import Assistant
|
||||
import Errors
|
||||
from gen.lib import MediaObject
|
||||
from BasicUtils import UpdateCallback
|
||||
from gen.updatecallback import UpdateCallback
|
||||
from PluginUtils import Tool
|
||||
from Utils import media_path_full, relative_path, media_path
|
||||
from TransUtils import sgettext as _
|
||||
|
@ -51,14 +51,14 @@ log = logging.getLogger(".Rebuild")
|
||||
#-------------------------------------------------------------------------
|
||||
from PluginUtils import Tool
|
||||
from QuestionDialog import OkDialog
|
||||
from BasicUtils import UpdateCallback
|
||||
from gen.updatecallback import UpdateCallback
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# runTool
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class Rebuild(Tool.Tool,UpdateCallback):
|
||||
class Rebuild(Tool.Tool, UpdateCallback):
|
||||
|
||||
def __init__(self, dbstate, uistate, options_class, name, callback=None):
|
||||
|
||||
@ -75,7 +75,7 @@ class Rebuild(Tool.Tool,UpdateCallback):
|
||||
uistate.progress.show()
|
||||
uistate.push_message(dbstate, _("Rebuilding secondary indices..."))
|
||||
|
||||
UpdateCallback.__init__(self,self.callback)
|
||||
UpdateCallback.__init__(self, self.callback)
|
||||
self.set_total(11)
|
||||
self.db.rebuild_secondary(self.update)
|
||||
self.reset()
|
||||
|
@ -53,14 +53,14 @@ log = logging.getLogger(".RebuildRefMap")
|
||||
#-------------------------------------------------------------------------
|
||||
from PluginUtils import Tool
|
||||
from QuestionDialog import OkDialog
|
||||
from BasicUtils import UpdateCallback
|
||||
from gen.updatecallback import UpdateCallback
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# runTool
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class RebuildRefMap(Tool.Tool,UpdateCallback):
|
||||
class RebuildRefMap(Tool.Tool, UpdateCallback):
|
||||
|
||||
def __init__(self, dbstate, uistate, options_class, name, callback=None):
|
||||
|
||||
@ -79,7 +79,7 @@ class RebuildRefMap(Tool.Tool,UpdateCallback):
|
||||
self.callback = None
|
||||
print "Rebuilding reference maps..."
|
||||
|
||||
UpdateCallback.__init__(self,self.callback)
|
||||
UpdateCallback.__init__(self, self.callback)
|
||||
self.set_total(6)
|
||||
self.db.reindex_reference_map(self.update)
|
||||
self.reset()
|
||||
|
@ -56,7 +56,7 @@ import gobject
|
||||
import Errors
|
||||
import ManagedWindow
|
||||
from DateHandler import displayer as _dd
|
||||
from BasicUtils import UpdateCallback
|
||||
from gen.updatecallback import UpdateCallback
|
||||
from PluginUtils import Tool
|
||||
from glade import Glade
|
||||
|
||||
|
@ -58,7 +58,7 @@ from gui.editors import EditPerson, EditFamily
|
||||
import Utils
|
||||
import GrampsDisplay
|
||||
from ManagedWindow import ManagedWindow
|
||||
from BasicUtils import UpdateCallback
|
||||
from gen.updatecallback import UpdateCallback
|
||||
from PluginUtils import Tool
|
||||
from TransUtils import sgettext as _
|
||||
from glade import Glade
|
||||
@ -224,11 +224,11 @@ def get_marriage_date(db,family):
|
||||
#-------------------------------------------------------------------------
|
||||
class Verify(Tool.Tool, ManagedWindow, UpdateCallback):
|
||||
|
||||
def __init__(self, dbstate, uistate, options_class, name,callback=None):
|
||||
def __init__(self, dbstate, uistate, options_class, name, callback=None):
|
||||
self.label = _('Database Verify tool')
|
||||
Tool.Tool.__init__(self, dbstate, options_class, name)
|
||||
ManagedWindow.__init__(self,uistate,[],self.__class__)
|
||||
UpdateCallback.__init__(self,self.uistate.pulse_progressbar)
|
||||
ManagedWindow.__init__(self, uistate,[], self.__class__)
|
||||
UpdateCallback.__init__(self, self.uistate.pulse_progressbar)
|
||||
|
||||
self.dbstate = dbstate
|
||||
if uistate:
|
||||
@ -237,11 +237,11 @@ class Verify(Tool.Tool, ManagedWindow, UpdateCallback):
|
||||
self.add_results = self.add_results_cli
|
||||
self.run_tool(cli=True)
|
||||
|
||||
def add_results_cli(self,results):
|
||||
def add_results_cli(self, results):
|
||||
# print data for the user, no GUI
|
||||
(msg,gramps_id, name,the_type,rule_id,severity, handle) = results
|
||||
(msg,gramps_id, name, the_type, rule_id, severity, handle) = results
|
||||
if severity == Rule.WARNING:
|
||||
print "W: %s, %s: %s, %s" % (msg,the_type,gramps_id, name)
|
||||
print "W: %s, %s: %s, %s" % (msg,the_type, gramps_id, name)
|
||||
elif severity == Rule.ERROR:
|
||||
print "E: %s, %s: %s, %s" % (msg,the_type,gramps_id, name)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user