[Kimchi-devel] [RFC PATCH V2 21/31] Fix import_module

Lucio Correia luciojhc at linux.vnet.ibm.com
Mon Jun 22 22:59:35 UTC 2015


This was necessary to make load_url_sub_nodes work with
new kimchi plugin structure.

Signed-off-by: Lucio Correia <luciojhc at linux.vnet.ibm.com>
Signed-off-by: Gustavo Y. Ribeiro <gyr at linux.vnet.ibm.com>
---
 src/wok/utils.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/wok/utils.py b/src/wok/utils.py
index af0d200..fa379d4 100644
--- a/src/wok/utils.py
+++ b/src/wok/utils.py
@@ -114,14 +114,14 @@ def get_all_tabs():
 def import_class(class_path):
     module_name, class_name = class_path.rsplit('.', 1)
     try:
-        mod = import_module(module_name)
+        mod = import_module(module_name, class_name)
         return getattr(mod, class_name)
     except (ImportError, AttributeError):
         raise ImportError('Class %s can not be imported' % class_path)
 
 
-def import_module(module_name):
-    return __import__(module_name, globals(), locals(), [''])
+def import_module(module_name, class_name=''):
+    return __import__(module_name, globals(), locals(), [class_name])
 
 
 def check_url_path(path):
-- 
1.7.1




More information about the Kimchi-devel mailing list