aboutsummaryrefslogtreecommitdiff
path: root/misc.py
diff options
context:
space:
mode:
Diffstat (limited to 'misc.py')
-rw-r--r--misc.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/misc.py b/misc.py
new file mode 100644
index 0000000..99fad74
--- /dev/null
+++ b/misc.py
@@ -0,0 +1,6 @@
+
+def import_class(cl):
+ d = cl.rfind(".")
+ classname = cl[d+1:len(cl)]
+ m = __import__(cl[0:d], globals(), locals(), [classname])
+ return getattr(m, classname)