Continued work on GEP008: Move BasicUtils/UpdateCallback.py to gen/updatecallback.py.
svn: r14025
This commit is contained in:
		| @@ -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: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user