From 3b6a3a55da911c4314ea657e3281d1da36b38b71 Mon Sep 17 00:00:00 2001 From: "Rafael.Timmerberg" Date: Wed, 19 Jun 2013 02:45:37 +0200 Subject: [PATCH] strange behavior, really really strange! I gues monthy python is coming from death to just kidding me! --- lib/config/parser.py | 13 +++++++++++-- lib/tasks/xmpp.py | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/config/parser.py b/lib/config/parser.py index d3b6ac3..746358f 100644 --- a/lib/config/parser.py +++ b/lib/config/parser.py @@ -1,4 +1,6 @@ from os.path import isfile +from os.path import join +from os import getcwd import json import sys import imp @@ -109,7 +111,8 @@ class ConfigParser: return mods["class"] else: mod = __import__(clazz) - #path = join("lib", modPart, clazz + ".py") + #path = join(getcwd(), "lib", modPart, clazz + ".py") + #self.log.w(path) #mod = imp.load_source(clazz, path) mods[clazz] = mod return mod @@ -128,6 +131,12 @@ class ConfigParser: items = items_func(obj) for clazzItem in items: try: + if "class" not in clazzItem: + self.log.w("python says class is not in class item!") + self.log.w(modPart) + self.log.w(clazzItem) + self.log.w(clazzItem["class"]) + clazz = clazzItem["class"] path = "lib/" + modPart sys.path.append(path) @@ -145,7 +154,7 @@ class ConfigParser: self.log.w("could not import " + clazz + ": " + str(clazzItem) + "! reason") self.log.w(str(err)) except KeyError, k: - self.log.w("Key '" + str(k) + "' not in classItem " + str(clazzItem)) + self.log.w("Key " + str(k) + " not in classItem " + str(clazzItem)) except Exception, e: self.log.w("Error while replacing class ( " + clazz + " ):" + str(e)) finally: diff --git a/lib/tasks/xmpp.py b/lib/tasks/xmpp.py index f6f2477..b5cf146 100644 --- a/lib/tasks/xmpp.py +++ b/lib/tasks/xmpp.py @@ -20,4 +20,4 @@ class XmppTask(Task): def create(taskDict): - return XmppTask(taskDict) \ No newline at end of file + return XmppTask(**taskDict) \ No newline at end of file