diff --git a/po/POTFILES.in b/po/POTFILES.in index 86da6757c..055d92aef 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -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 diff --git a/src/BasicUtils/Makefile.am b/src/BasicUtils/Makefile.am index ae5fcf978..e8ac06c52 100644 --- a/src/BasicUtils/Makefile.am +++ b/src/BasicUtils/Makefile.am @@ -6,7 +6,6 @@ pkgdatadir = $(datadir)/@PACKAGE@/BasicUtils pkgdata_PYTHON = \ - _UpdateCallback.py\ _NameDisplay.py\ __init__.py diff --git a/src/BasicUtils/__init__.py b/src/BasicUtils/__init__.py index 81e73457b..b8e1cdbd1 100644 --- a/src/BasicUtils/__init__.py +++ b/src/BasicUtils/__init__.py @@ -20,5 +20,4 @@ # $Id: __init__.py$ -from _UpdateCallback import UpdateCallback from _NameDisplay import displayer as name_displayer diff --git a/src/gen/Makefile.am b/src/gen/Makefile.am index 23fd6be47..399654657 100644 --- a/src/gen/Makefile.am +++ b/src/gen/Makefile.am @@ -13,7 +13,8 @@ SUBDIRS = \ pkgdatadir = $(datadir)/@PACKAGE@/gen pkgdata_PYTHON = \ - __init__.py + __init__.py \ + updatecallback.py pkgpyexecdir = @pkgpyexecdir@/gen pkgpythondir = @pkgpythondir@/gen diff --git a/src/gen/db/write.py b/src/gen/db/write.py index af9717fb1..7517bc050 100644 --- a/src/gen/db/write.py +++ b/src/gen/db/write.py @@ -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) diff --git a/src/BasicUtils/_UpdateCallback.py b/src/gen/updatecallback.py similarity index 100% rename from src/BasicUtils/_UpdateCallback.py rename to src/gen/updatecallback.py diff --git a/src/plugins/export/ExportGedcom.py b/src/plugins/export/ExportGedcom.py index 305716b65..1e24e1545 100644 --- a/src/plugins/export/ExportGedcom.py +++ b/src/plugins/export/ExportGedcom.py @@ -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 diff --git a/src/plugins/export/ExportPkg.py b/src/plugins/export/ExportPkg.py index 36d760643..8565c25e8 100644 --- a/src/plugins/export/ExportPkg.py +++ b/src/plugins/export/ExportPkg.py @@ -59,7 +59,6 @@ import gtk # #------------------------------------------------------------------------- from ExportOptions import WriterOptionBox -#from BasicUtils import UpdateCallback import gen.proxy from ExportXml import XmlWriter import Utils diff --git a/src/plugins/export/ExportXml.py b/src/plugins/export/ExportXml.py index 908856e4e..9483a0659 100644 --- a/src/plugins/export/ExportXml.py +++ b/src/plugins/export/ExportXml.py @@ -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 diff --git a/src/plugins/import/ImportGrdb.py b/src/plugins/import/ImportGrdb.py index de9f5e9e5..0418c1291 100644 --- a/src/plugins/import/ImportGrdb.py +++ b/src/plugins/import/ImportGrdb.py @@ -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 #------------------------------------------------------------------------- diff --git a/src/plugins/import/ImportXml.py b/src/plugins/import/ImportXml.py index eb60a836a..a493ca836 100644 --- a/src/plugins/import/ImportXml.py +++ b/src/plugins/import/ImportXml.py @@ -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 diff --git a/src/plugins/lib/libgedcom.py b/src/plugins/lib/libgedcom.py index c3ce80a3c..29213aa2c 100644 --- a/src/plugins/lib/libgedcom.py +++ b/src/plugins/lib/libgedcom.py @@ -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 diff --git a/src/plugins/tool/MediaManager.py b/src/plugins/tool/MediaManager.py index 4d86c6824..b2fae4e22 100644 --- a/src/plugins/tool/MediaManager.py +++ b/src/plugins/tool/MediaManager.py @@ -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 _ diff --git a/src/plugins/tool/Rebuild.py b/src/plugins/tool/Rebuild.py index 93f1dc62d..c7a5efb9e 100644 --- a/src/plugins/tool/Rebuild.py +++ b/src/plugins/tool/Rebuild.py @@ -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() diff --git a/src/plugins/tool/RebuildRefMap.py b/src/plugins/tool/RebuildRefMap.py index 070214e6e..0c71e4f01 100644 --- a/src/plugins/tool/RebuildRefMap.py +++ b/src/plugins/tool/RebuildRefMap.py @@ -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() diff --git a/src/plugins/tool/RemoveUnused.py b/src/plugins/tool/RemoveUnused.py index 07c2e38b9..4d826ac8e 100644 --- a/src/plugins/tool/RemoveUnused.py +++ b/src/plugins/tool/RemoveUnused.py @@ -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 diff --git a/src/plugins/tool/Verify.py b/src/plugins/tool/Verify.py index ddaedf523..91fdb2f5d 100644 --- a/src/plugins/tool/Verify.py +++ b/src/plugins/tool/Verify.py @@ -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: