* src/plugins/DesGraph.py: Use correct constant.

* src/plugins/Eval.py: Convert to new API.
* src/plugins/Leak.py: Convert to new API.


svn: r5263
This commit is contained in:
Alex Roitman 2005-10-02 02:51:01 +00:00
parent 2eef51be37
commit dd697dcb69
4 changed files with 54 additions and 18 deletions

View File

@ -3,6 +3,9 @@
* src/plugins/verify.glade: Use separate windows for errors and
warnings.
* src/plugins/Check.py: Convert to new API.
* src/plugins/DesGraph.py: Use correct constant.
* src/plugins/Eval.py: Convert to new API.
* src/plugins/Leak.py: Convert to new API.
2005-09-30 Alex Roitman <shura@gramps-project.org>
* src/docgen/KwordDoc.py: Remove unused latin_utf8 import.

View File

@ -46,7 +46,6 @@ import Report
import BaseDoc
from SubstKeywords import SubstKeywords
from ReportUtils import pt2cm
import const
import ReportOptions
#------------------------------------------------------------------------
@ -341,7 +340,7 @@ class DescendantGraphOptions(ReportOptions.ReportOptions):
from PluginMgr import register_report
register_report(
name = 'descendant_graph',
category = const.CATEGORY_DRAW,
category = Report.CATEGORY_DRAW,
report_class = DescendantGraph,
options_class = DescendantGraphOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI,

View File

@ -47,15 +47,17 @@ import gtk.glade
#
#------------------------------------------------------------------------
import Utils
import Tool
#-------------------------------------------------------------------------
#
# Actual tool
#
#-------------------------------------------------------------------------
class EvalWindow:
class Eval(Tool.Tool):
def __init__(self,db,person,options_class,name,callback=None,parent=None):
Tool.Tool.__init__(self,db,person,options_class,name)
def __init__(self,parent):
self.parent = parent
if self.parent.child_windows.has_key(self.__class__):
self.parent.child_windows[self.__class__].present(None)
@ -124,6 +126,19 @@ class EvalWindow:
self.ebuf.set_text("")
self.error.set_text("")
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
class EvalOptions(Tool.ToolOptions):
"""
Defines options and provides handling interface.
"""
def __init__(self,name,person_id=None):
Tool.ToolOptions.__init__(self,name,person_id)
#------------------------------------------------------------------------
#
#
@ -131,12 +146,14 @@ class EvalWindow:
#------------------------------------------------------------------------
from PluginMgr import register_tool
def runtool(database,person,callback,parent):
EvalWindow(parent)
register_tool(
runtool,
_("Python evaluation window"),
category=_("Debug"),
name = 'eval',
category = Tool.TOOL_DEBUG,
tool_class = Eval,
options_class = EvalOptions,
modes = Tool.MODE_GUI,
translated_name = _("Python evaluation window"),
author_name = "Donald N. Allingham",
author_email = "dallingham@users.sourceforge.net",
description=_("Provides a window that can evaluate python code")
)

View File

@ -47,15 +47,17 @@ import gc
#
#------------------------------------------------------------------------
import Utils
import Tool
#-------------------------------------------------------------------------
#
# Actual tool
#
#-------------------------------------------------------------------------
class Leak:
class Leak(Tool.Tool):
def __init__(self,db,person,options_class,name,callback=None,parent=None):
Tool.Tool.__init__(self,db,person,options_class,name)
def __init__(self,parent):
self.parent = parent
if self.parent.child_windows.has_key(self.__class__):
self.parent.child_windows[self.__class__].present(None)
@ -120,6 +122,19 @@ class Leak:
def apply_clicked(self,obj):
self.display()
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
class LeakOptions(Tool.ToolOptions):
"""
Defines options and provides handling interface.
"""
def __init__(self,name,person_id=None):
Tool.ToolOptions.__init__(self,name,person_id)
#------------------------------------------------------------------------
#
#
@ -127,12 +142,14 @@ class Leak:
#------------------------------------------------------------------------
from PluginMgr import register_tool
def runtool(database,person,callback,parent=None):
Leak(parent)
register_tool(
runtool,
_("Show uncollected objects"),
category=_("Debug"),
name = 'eval',
category = Tool.TOOL_DEBUG,
tool_class = Leak,
options_class = LeakOptions,
modes = Tool.MODE_GUI,
translated_name = _("Show uncollected objects"),
author_name = "Donald N. Allingham",
author_email = "dallingham@users.sourceforge.net",
description=_("Provide a window listing all uncollected objects"),
)