plugins/tools: make file path build logic conform to Python standards
svn: r12450
This commit is contained in:
parent
1c7daa4ed5
commit
82aac3836f
@ -53,6 +53,13 @@ from QuestionDialog import OkDialog
|
||||
from PluginUtils import Tool
|
||||
from gen.plug import PluginManager
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_GLADE_FILE = "changetype.glade"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@ -77,8 +84,10 @@ class ChangeTypes(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
||||
def init_gui(self):
|
||||
# Draw dialog and make it handle everything
|
||||
|
||||
base = os.path.dirname(__file__)
|
||||
glade_file = base + os.sep + "changetype.glade"
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
self.glade = gtk.Builder()
|
||||
self.glade.add_from_file(glade_file)
|
||||
|
||||
|
@ -65,6 +65,13 @@ from gen.plug import PluginManager
|
||||
from QuestionDialog import OkDialog, MissingMediaDialog
|
||||
from BasicUtils import name_displayer as _nd
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_GLADE_FILE = "summary.glade"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Low Level repair
|
||||
@ -1621,8 +1628,10 @@ class Report(ManagedWindow.ManagedWindow):
|
||||
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self)
|
||||
|
||||
base = os.path.dirname(__file__)
|
||||
glade_file = base + os.sep + "summary.glade"
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
topDialog = gtk.Builder()
|
||||
topDialog.add_from_file(glade_file)
|
||||
topDialog.get_object("close").connect('clicked',self.close)
|
||||
|
@ -56,10 +56,7 @@ from TransUtils import sgettext as _
|
||||
#------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = '%s_-_Tools' % const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Interactive_Descendant_Browser...')
|
||||
|
||||
|
||||
|
||||
|
||||
_GLADE_FILE = "desbrowse.glade"
|
||||
|
||||
class DesBrowse(Tool.ActivePersonTool, ManagedWindow.ManagedWindow):
|
||||
|
||||
@ -77,8 +74,10 @@ class DesBrowse(Tool.ActivePersonTool, ManagedWindow.ManagedWindow):
|
||||
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self)
|
||||
|
||||
base = os.path.dirname(__file__)
|
||||
glade_file = base + os.sep + "desbrowse.glade"
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
self.glade = gtk.Builder()
|
||||
self.glade.add_from_file(glade_file)
|
||||
self.glade.connect_signals({
|
||||
|
@ -50,6 +50,13 @@ from PluginUtils import Tool
|
||||
from gen.plug import PluginManager
|
||||
import ManagedWindow
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_GLADE_FILE = "eval.glade"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Actual tool
|
||||
@ -62,9 +69,10 @@ class Eval(Tool.Tool,ManagedWindow.ManagedWindow):
|
||||
Tool.Tool.__init__(self,dbstate, options_class, name)
|
||||
ManagedWindow.ManagedWindow.__init__(self,uistate,[],self.__class__)
|
||||
|
||||
base = os.path.dirname(__file__)
|
||||
glade_file = base + os.sep + "eval.glade"
|
||||
glade_file = '/tmp/eval.glade'
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
self.glade = gtk.Builder()
|
||||
self.glade.add_from_file(glade_file)
|
||||
|
||||
|
@ -71,6 +71,7 @@ _val2label = {
|
||||
|
||||
WIKI_HELP_PAGE = '%s_-_Tools' % const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Find_Possible_Duplicate_People...')
|
||||
_GLADE_FILE = "merge.glade"
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@ -108,9 +109,11 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow):
|
||||
self.update = callback
|
||||
self.use_soundex = 1
|
||||
|
||||
base = os.path.dirname(__file__)
|
||||
self.glade_file = base + os.sep + "merge.glade"
|
||||
top = glade.XML(self.glade_file,"dialog","gramps")
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
top = glade.XML(glade_file,"dialog","gramps")
|
||||
|
||||
# retrieve options
|
||||
threshold = self.options.handler.options_dict['threshold']
|
||||
|
@ -53,6 +53,13 @@ from gen.plug import PluginManager
|
||||
import ManagedWindow
|
||||
from QuestionDialog import InfoDialog
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_GLADE_FILE = "leak.glade"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Actual tool
|
||||
@ -65,7 +72,10 @@ class Leak(Tool.Tool,ManagedWindow.ManagedWindow):
|
||||
Tool.Tool.__init__(self,dbstate, options_class, name)
|
||||
ManagedWindow.ManagedWindow.__init__(self,uistate,[],self.__class__)
|
||||
|
||||
glade_file = os.path.dirname(__file__) + os.sep + "leak.glade"
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
self.glade = gtk.Builder()
|
||||
self.glade.add_from_file(glade_file)
|
||||
|
||||
|
@ -61,6 +61,7 @@ from TransUtils import sgettext as _
|
||||
#-------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = '%s_-_Tools' % const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Not_Related...')
|
||||
_GLADE_FILE = "NotRelated.glade"
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@ -82,8 +83,10 @@ class NotRelated(Tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
|
||||
self.uistate = uistate
|
||||
self.db = dbstate.db
|
||||
|
||||
base = os.path.dirname(__file__)
|
||||
glade_file = base + os.sep + "NotRelated.glade"
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
topDialog = gtk.Builder()
|
||||
topDialog.add_from_file(glade_file)
|
||||
|
||||
|
@ -51,6 +51,13 @@ from QuestionDialog import ErrorDialog
|
||||
from PluginUtils import Tool
|
||||
from gen.plug import PluginManager
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_GLADE_FILE = "relcalc.glade"
|
||||
|
||||
column_names = [
|
||||
_('Name'),
|
||||
_('ID') ,
|
||||
@ -84,8 +91,10 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow):
|
||||
self.relationship = pmgr.get_relationship_calculator()
|
||||
self.relationship.connect_db_signals(dbstate)
|
||||
|
||||
base = os.path.dirname(__file__)
|
||||
glade_file = base + os.sep + "relcalc.glade"
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
self.glade = gtk.Builder()
|
||||
self.glade.add_from_file(glade_file)
|
||||
|
||||
|
@ -61,6 +61,14 @@ from BasicUtils import UpdateCallback
|
||||
from PluginUtils import Tool
|
||||
from gen.plug import PluginManager
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_GLADE_FILE = "unused.glade"
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# runTool
|
||||
@ -129,11 +137,13 @@ class RemoveUnused(Tool.Tool,ManagedWindow.ManagedWindow,UpdateCallback):
|
||||
self.init_gui()
|
||||
|
||||
def init_gui(self):
|
||||
base = os.path.dirname(__file__)
|
||||
self.glade_file = base + os.sep + "unused.glade"
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
|
||||
self.top = gtk.Builder()
|
||||
self.top.add_from_file(self.glade_file)
|
||||
self.top.add_from_file(glade_file)
|
||||
window = self.top.get_object("unused")
|
||||
self.set_window(window,self.top.get_object('title'),self.title)
|
||||
|
||||
|
@ -58,6 +58,8 @@ from gen.plug import PluginManager
|
||||
#-------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = '%s_-_Tools' % const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Generate_SoundEx_codes')
|
||||
_GLADE_FILE = "soundex.glade"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# SoundGen.py
|
||||
@ -71,8 +73,9 @@ class SoundGen(Tool.Tool, ManagedWindow.ManagedWindow):
|
||||
Tool.Tool.__init__(self, dbstate, options_class, name)
|
||||
ManagedWindow.ManagedWindow.__init__(self,uistate,[],self.__class__)
|
||||
|
||||
base = os.path.dirname(__file__)
|
||||
glade_file = base + os.sep + "soundex.glade"
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
self.glade = gtk.Builder()
|
||||
self.glade.add_from_file(glade_file)
|
||||
|
@ -68,6 +68,7 @@ from TransUtils import sgettext as _
|
||||
#-------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = '%s_-_Tools' % const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Verify_the_Data...')
|
||||
_GLADE_FILE = "verify.glade"
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -245,13 +246,13 @@ class Verify(Tool.Tool, ManagedWindow, UpdateCallback):
|
||||
|
||||
def init_gui(self):
|
||||
# Draw dialog and make it handle everything
|
||||
base = os.path.dirname(__file__)
|
||||
self.glade_file = base + os.sep + "verify.glade"
|
||||
self.vr = None
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
self.top = gtk.Builder()
|
||||
# self.add_from_file(self.glade_file),"verify_settings","gramps")
|
||||
self.top.add_from_file(self.glade_file)
|
||||
self.top.add_from_file(glade_file)
|
||||
self.top.connect_signals({
|
||||
"destroy_passed_object" : self.close,
|
||||
"on_help_clicked" : self.on_help_clicked,
|
||||
@ -413,10 +414,12 @@ class VerifyResults(ManagedWindow):
|
||||
|
||||
self.dbstate = dbstate
|
||||
|
||||
base = os.path.dirname(__file__)
|
||||
self.glade_file = base + os.sep + "verify.glade"
|
||||
glade_file = os.path.join(
|
||||
os.path.split(__file__)[0],
|
||||
_GLADE_FILE)
|
||||
|
||||
self.top = gtk.Builder()
|
||||
self.top.add_from_file(self.glade_file)
|
||||
self.top.add_from_file(glade_file)
|
||||
window = self.top.get_object("verify_result")
|
||||
self.set_window(window,self.top.get_object('title'),self.title)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user