summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorChristoph Erhardt <kolab@sicherha.de>2022-05-08 10:12:12 +0200
committerChristoph Erhardt <kolab@sicherha.de>2022-05-08 10:12:33 +0200
commitc2b69efbdd07a6c30dd9034745648c5e36f7dbd5 (patch)
tree36ede97e4e5a3f885e1394eb1df7317a556d44a5 /pykolab
parent8add8bba35df98a087225bfa9f0c534702c3e51d (diff)
downloadpykolab-c2b69efbdd07a6c30dd9034745648c5e36f7dbd5.tar.gz
[Python 3] relative imports fixes (dynamic imports) Part 2
Summary: some more dynamic imports of relative path's found and dotted Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Differential Revision: https://git.kolab.org/D3484
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/cli/commands.py2
-rw-r--r--pykolab/setup/components.py8
2 files changed, 5 insertions, 5 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=[]):