Bug 3011: change old-style classes to new-style classes
svn: r12559
This commit is contained in:
@@ -71,7 +71,7 @@ tool_categories = {
|
||||
# Tool
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class Tool:
|
||||
class Tool(object):
|
||||
"""
|
||||
The Tool base class. This is a base class for generating
|
||||
customized tools. It cannot be used as is, but it can be easily
|
||||
@@ -82,13 +82,14 @@ class Tool:
|
||||
from PluginUtils import MenuToolOptions
|
||||
self.db = dbstate.db
|
||||
self.person = dbstate.active
|
||||
if issubclass(options_class, MenuToolOptions):
|
||||
# FIXME: pass in person_id
|
||||
self.options = options_class(name, None, dbstate)
|
||||
elif isinstance(options_class, ClassType):
|
||||
self.options = options_class(name)
|
||||
elif isinstance(options_class, InstanceType):
|
||||
self.options = options_class
|
||||
try:
|
||||
if issubclass(options_class, MenuToolOptions):
|
||||
# FIXME: pass in person_id
|
||||
self.options = options_class(name, None, dbstate)
|
||||
else: # must be some kind of class or we get a TypeError
|
||||
self.options = option_class(name)
|
||||
except TypeError:
|
||||
self.options = option_class
|
||||
self.options.load_previous_values()
|
||||
|
||||
def run_tool(self):
|
||||
@@ -147,7 +148,7 @@ class ActivePersonTool(Tool):
|
||||
# Command-line tool
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
class CommandLineTool:
|
||||
class CommandLineTool(object):
|
||||
"""
|
||||
Provide a way to run tool from the command line.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user