|
@ -49,7 +49,7 @@ def getConfigPath(job, modul, name, subname=""): |
|
|
if modul == P.KEY_TOOL: |
|
|
if modul == P.KEY_TOOL: |
|
|
for format in CONFIG_FORMAT: |
|
|
for format in CONFIG_FORMAT: |
|
|
pathname = os.path.join(job.conf.getPath(P.ATTR_PATH_COMPONENTS), |
|
|
pathname = os.path.join(job.conf.getPath(P.ATTR_PATH_COMPONENTS), |
|
|
P.KEY_TOOL+"_"+name+"."+format) |
|
|
P.VAL_CONFIG, P.KEY_TOOL+"_"+name+"."+format) |
|
|
job.debug(verify, "1 " + pathname) |
|
|
job.debug(verify, "1 " + pathname) |
|
|
if os.path.exists(pathname): |
|
|
if os.path.exists(pathname): |
|
|
return pathname |
|
|
return pathname |
|
@ -105,7 +105,7 @@ def getConfigPath(job, modul, name, subname=""): |
|
|
elif modul == P.KEY_BASIC: |
|
|
elif modul == P.KEY_BASIC: |
|
|
for format in CONFIG_FORMAT: |
|
|
for format in CONFIG_FORMAT: |
|
|
pathname = os.path.join(job.conf.getPath(P.ATTR_PATH_COMPONENTS), |
|
|
pathname = os.path.join(job.conf.getPath(P.ATTR_PATH_COMPONENTS), |
|
|
name + "."+format) |
|
|
P.VAL_CONFIG , name + "."+format) |
|
|
job.debug(verify, "4 " + pathname) |
|
|
job.debug(verify, "4 " + pathname) |
|
|
if os.path.exists(pathname): |
|
|
if os.path.exists(pathname): |
|
|
return pathname |
|
|
return pathname |
|
@ -172,7 +172,7 @@ def getConfigPath(job, modul, name, subname=""): |
|
|
job.debug(verify, "9 " + pathname) |
|
|
job.debug(verify, "9 " + pathname) |
|
|
if os.path.exists(pathname): |
|
|
if os.path.exists(pathname): |
|
|
return pathname |
|
|
return pathname |
|
|
raise Exception(P.EXP_CONFIG_MISSING, modul+", "+name) |
|
|
raise Exception(P.EXP_CONFIG_MISSING, modul+", "+name) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getConfValue(attribute, comp): |
|
|
def getConfValue(attribute, comp): |
|
@ -189,41 +189,30 @@ def getConfValue(attribute, comp): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getAttr(o, name): |
|
|
def getAttr(o, name): |
|
|
#print("hasAttr " + str(type(o))+" "+name) |
|
|
|
|
|
if (isinstance(o, dict)): |
|
|
if (isinstance(o, dict)): |
|
|
if (name in o.keys()): |
|
|
if (name in o.keys()): |
|
|
#print("hasAttr dict ok " + str(type(o))) |
|
|
|
|
|
return o[name] |
|
|
return o[name] |
|
|
#print("hasAttr dict "+str(type(o))) |
|
|
|
|
|
elif (isinstance(o, list)): |
|
|
elif (isinstance(o, list)): |
|
|
pass |
|
|
pass |
|
|
#print("hasAttr list "+str(type(o))) |
|
|
|
|
|
elif hasattr(o, name): |
|
|
elif hasattr(o, name): |
|
|
#print("hasAttr class ok "+str(type(o))) |
|
|
|
|
|
return getattr(o, name) |
|
|
return getattr(o, name) |
|
|
return False |
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def hasAttr(o, name): |
|
|
def hasAttr(o, name): |
|
|
#print("hasAttr " + str(type(o))+" "+name) |
|
|
|
|
|
if (isinstance(o, dict)): |
|
|
if (isinstance(o, dict)): |
|
|
if (name in o.keys()): |
|
|
if (name in o.keys()): |
|
|
#print("hasAttr dict ok " + str(type(o))) |
|
|
|
|
|
return True |
|
|
return True |
|
|
#print("hasAttr dict "+str(type(o))) |
|
|
|
|
|
elif (isinstance(o, list)): |
|
|
elif (isinstance(o, list)): |
|
|
pass |
|
|
pass |
|
|
#print("hasAttr list "+str(type(o))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif hasattr(o, name): |
|
|
elif hasattr(o, name): |
|
|
#print("hasAttr class ok "+str(type(o))) |
|
|
|
|
|
return True |
|
|
return True |
|
|
return False |
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getConfig(job, modul, name, subname=""): |
|
|
def getConfig(job, modul, name, subname=""): |
|
|
#job = basic.program.Job.getInstance() |
|
|
|
|
|
if job is None: |
|
|
if job is None: |
|
|
verify = 24 |
|
|
verify = 24 |
|
|
else: |
|
|
else: |
|
|