|
|
@ -39,7 +39,7 @@ class Catalog: |
|
|
|
return Catalog.__instance |
|
|
|
|
|
|
|
|
|
|
|
def getValue(self, domain, key, job): |
|
|
|
def getValue(self, job, domain, key, subkey=""): |
|
|
|
""" |
|
|
|
this function gets the value of the domain an key |
|
|
|
:param domain: |
|
|
@ -57,6 +57,11 @@ class Catalog: |
|
|
|
if key not in self.catalog[domain]: |
|
|
|
job.m.setError(EXP_KEY_DOESNT_EXIST+" ("+domain+", "+key+")") |
|
|
|
return "" |
|
|
|
if len(subkey) > 0: |
|
|
|
if subkey not in self.catalog[domain][key]: |
|
|
|
job.m.setError(EXP_KEY_DOESNT_EXIST + " (" + domain + ", " + key + ", " + subkey + ")") |
|
|
|
return "" |
|
|
|
return self.catalog[domain][key][subkey] |
|
|
|
return self.catalog[domain][key] |
|
|
|
|
|
|
|
|
|
|
@ -93,7 +98,11 @@ class Catalog: |
|
|
|
pathname = tools.config_tool.getConfigPath(job, P.KEY_CATALOG, domain) |
|
|
|
if pathname is None: |
|
|
|
raise Exception(EXP_KEY_MISSING, (domain)) |
|
|
|
data = tools.file_tool.readFileDict(job, pathname, job.m) |
|
|
|
if hasattr(job, "m"): |
|
|
|
msg = job.m |
|
|
|
else: |
|
|
|
msg = None |
|
|
|
data = tools.file_tool.readFileDict(job, pathname, msg) |
|
|
|
self.catalog[domain] = data[B.DATA_NODE_TABLES][domain][B.DATA_NODE_KEYS] |
|
|
|
return data |
|
|
|
|
|
|
|