|
@@ -24,7 +24,6 @@ import sys
|
|
import ConfigParser
|
|
import ConfigParser
|
|
import re
|
|
import re
|
|
import optparse
|
|
import optparse
|
|
-import logging
|
|
|
|
|
|
|
|
class MultiOptionParser(optparse.OptionParser):
|
|
class MultiOptionParser(optparse.OptionParser):
|
|
|
|
|
|
@@ -121,8 +120,6 @@ class Loader(object):
|
|
result.append(child)
|
|
result.append(child)
|
|
return result
|
|
return result
|
|
|
|
|
|
- logging.debug("Additional plugin loading locations: " + str(directories))
|
|
|
|
-
|
|
|
|
# configure python path for loading
|
|
# configure python path for loading
|
|
std_ext_dir = os.path.join(os.environ['METRIXPLUSPLUS_INSTALL_DIR'], 'ext')
|
|
std_ext_dir = os.path.join(os.environ['METRIXPLUSPLUS_INSTALL_DIR'], 'ext')
|
|
std_ext_priority_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
std_ext_priority_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
@@ -141,12 +138,12 @@ class Loader(object):
|
|
for each in list_dependants_recursively(inicontainer, name):
|
|
for each in list_dependants_recursively(inicontainer, name):
|
|
if each not in required_and_dependant_plugins:
|
|
if each not in required_and_dependant_plugins:
|
|
required_and_dependant_plugins.append(each)
|
|
required_and_dependant_plugins.append(each)
|
|
- required_and_dependant_plugins.append(name)
|
|
|
|
|
|
+ if name not in required_and_dependant_plugins:
|
|
|
|
+ required_and_dependant_plugins.append(name)
|
|
|
|
|
|
# load
|
|
# load
|
|
for plugin_name in required_and_dependant_plugins:
|
|
for plugin_name in required_and_dependant_plugins:
|
|
item = inicontainer.hash[plugin_name]
|
|
item = inicontainer.hash[plugin_name]
|
|
- logging.debug("Loading plugin: " + str(item['package']) + ' ' + str(item['module']))
|
|
|
|
plugin = __import__(item['package'], globals(), locals(), [item['module']], -1)
|
|
plugin = __import__(item['package'], globals(), locals(), [item['module']], -1)
|
|
module_attr = plugin.__getattribute__(item['module'])
|
|
module_attr = plugin.__getattribute__(item['module'])
|
|
class_attr = module_attr.__getattribute__(item['class'])
|
|
class_attr = module_attr.__getattribute__(item['class'])
|
|
@@ -181,9 +178,7 @@ class Loader(object):
|
|
|
|
|
|
for item in self.iterate_plugins():
|
|
for item in self.iterate_plugins():
|
|
if (isinstance(item, mpp.api.IConfigurable)):
|
|
if (isinstance(item, mpp.api.IConfigurable)):
|
|
- logging.debug("declaring options for " + item.get_name())
|
|
|
|
item.declare_configuration(optparser)
|
|
item.declare_configuration(optparser)
|
|
- logging.debug("after has option std.code.lines.code " + str(optparser.has_option('--std.code.lines.code')))
|
|
|
|
|
|
|
|
(options, args) = optparser.parse_args(args)
|
|
(options, args) = optparser.parse_args(args)
|
|
for item in self.iterate_plugins():
|
|
for item in self.iterate_plugins():
|