|
@@ -24,6 +24,7 @@ import sys
|
|
import ConfigParser
|
|
import ConfigParser
|
|
import re
|
|
import re
|
|
import optparse
|
|
import optparse
|
|
|
|
+import logging
|
|
|
|
|
|
class MultiOptionParser(optparse.OptionParser):
|
|
class MultiOptionParser(optparse.OptionParser):
|
|
|
|
|
|
@@ -120,6 +121,8 @@ 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__)))
|
|
@@ -143,6 +146,7 @@ class Loader(object):
|
|
# 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'])
|
|
@@ -177,7 +181,9 @@ 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():
|