summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pykolab/cli/commands.py2
-rw-r--r--pykolab/setup/components.py8
-rw-r--r--wallace/modules.py4
3 files changed, 7 insertions, 7 deletions
diff --git a/pykolab/cli/commands.py b/pykolab/cli/commands.py
index 16ef753..072c346 100644
--- a/pykolab/cli/commands.py
+++ b/pykolab/cli/commands.py
@@ -130,7 +130,7 @@ def execute(cmd_name, *args, **kw):
else:
command_name = commands[cmd_name]['cmd_name']
try:
- exec("from cmd_%s import cli_options as %s_cli_options" % (command_name,command_name))
+ exec("from .cmd_%s import cli_options as %s_cli_options" % (command_name,command_name))
exec("%s_cli_options()" % (command_name))
except ImportError:
pass
diff --git a/pykolab/setup/components.py b/pykolab/setup/components.py
index e865015..bb01f9c 100644
--- a/pykolab/setup/components.py
+++ b/pykolab/setup/components.py
@@ -50,7 +50,7 @@ def __init__():
module_name = filename.replace('.py','')
component_name = module_name.replace('setup_', '')
#print "exec(\"from %s import __init__ as %s_register\"" % (module_name,component_name)
- exec("from %s import __init__ as %s_register" % (module_name,component_name))
+ exec("from .%s import __init__ as %s_register" % (module_name,component_name))
exec("%s_register()" % (component_name))
for dirname in dirnames:
@@ -129,14 +129,14 @@ def cli_options_from_component(component_name, *args, **kw):
group = components[component_name]['group']
component_name = components[component_name]['component_name']
try:
- exec("from %s.setup_%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:
pass
else:
try:
- exec("from setup_%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:
pass
@@ -216,7 +216,7 @@ def register_group(dirname, module):
module_name = filename.replace('.py','')
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("from .%s.%s import __init__ as %s_%s_register" % (module,module_name,module,component_name))
exec("%s_%s_register()" % (module,component_name))
def register(component_name, func, group=None, description=None, aliases=[], after=[], before=[]):
diff --git a/wallace/modules.py b/wallace/modules.py
index ac7790b..a1eaa7a 100644
--- a/wallace/modules.py
+++ b/wallace/modules.py
@@ -65,7 +65,7 @@ def initialize():
module_name = filename.replace('.py', '')
name = module_name.replace('module_', '')
# print("exec(\"from %s import __init__ as %s_register\")" % (module_name,name))
- exec("from %s import __init__ as %s_register" % (module_name, name))
+ exec("from .%s import __init__ as %s_register" % (module_name, name))
exec("%s_register()" % (name))
for dirname in dirnames:
@@ -408,7 +408,7 @@ def register_group(dirname, module):
name = module_name.replace('module_', '')
# TODO: Error recovery from incomplete / incorrect modules.
exec(
- "from %s.%s import __init__ as %s_%s_register" % (
+ "from .%s.%s import __init__ as %s_%s_register" % (
module,
module_name,
module,