summaryrefslogtreecommitdiffstats
path: root/pykolab/setup/components.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-21 15:58:11 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-21 15:58:11 +0100
commit8f4dbeeaf917f4fb6fa4cf693ab131fa444144ed (patch)
tree17b1e4b65a3b37e6892dc427c380cd5983e60b4f /pykolab/setup/components.py
parent0eab2f43ac6bcfb72b1f8fb970376aca11d2d328 (diff)
downloadpykolab-8f4dbeeaf917f4fb6fa4cf693ab131fa444144ed.tar.gz
Allow setup components to add cli options, and suppress sequencing output
Diffstat (limited to 'pykolab/setup/components.py')
-rw-r--r--pykolab/setup/components.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/pykolab/setup/components.py b/pykolab/setup/components.py
index 432844b..4633160 100644
--- a/pykolab/setup/components.py
+++ b/pykolab/setup/components.py
@@ -128,7 +128,6 @@ def execute(component_name, *args, **kw):
execute_this = True
if component in executed_components:
- print "component", component, "already executed, continuing"
execute_this = False
if component == "help":
@@ -136,10 +135,8 @@ def execute(component_name, *args, **kw):
if execute_this:
if components[component].has_key('after'):
- print "component", component, "has after key, let's see what it holds"
for _component in components[component]['after']:
if not _component in executed_components:
- print "component", component, "is waiting for component", _component
execute_this = False
if execute_this:
@@ -169,14 +166,14 @@ def execute(component_name, *args, **kw):
group = components[component_name]['group']
component_name = components[component_name]['component_name']
try:
- exec("from %s.cmd_%s import cli_options as %s_%s_cli_options" % (group,component_name,group,component_name))
+ exec("from %s.setup_%s import cli_options as %s_%s_cli_options" % (group,component_name,group,component_name))
exec("%s_%s_cli_options()" % (group,component_name))
except ImportError, e:
pass
else:
try:
- exec("from cmd_%s import cli_options as %s_cli_options" % (component_name,component_name))
+ exec("from setup_%s import cli_options as %s_cli_options" % (component_name,component_name))
exec("%s_cli_options()" % (component_name))
except ImportError, e:
pass
@@ -200,9 +197,9 @@ def register_group(dirname, module):
continue
for filename in filenames:
- if filename.startswith('cmd_') and filename.endswith('.py'):
+ if filename.startswith('setup_') and filename.endswith('.py'):
module_name = filename.replace('.py','')
- component_name = module_name.replace('cmd_', '')
+ component_name = module_name.replace('setup_', '')
#print "exec(\"from %s.%s import __init__ as %s_%s_register\"" % (module,module_name,module,component_name)
exec("from %s.%s import __init__ as %s_%s_register" % (module,module_name,module,component_name))
exec("%s_%s_register()" % (module,component_name))