Commit 3ce0574e authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent d373ca10
......@@ -194,47 +194,47 @@ class Workflow(threading.Thread):
reader = ConfigParser()
reader.read(self._get_property_path())
parameters = []
#try:
params = {}
# First grab all parameters name
for param in reader.items("parameters"):
cvalue = reader.get("parameters", param[0])
cparam = param[0].split(".")[0]
ckey = param[0].split(".")[1]
if not params.has_key(cparam):
params[cparam] = {ckey: cvalue}
else:
params[cparam][ckey] = cvalue
# Then build params
for param in params:
name = params[param]["name"]
flag = params[param]["flag"]
help = params[param]["help"]
try: default = params[param]["default"]
except: default = None
# handle type values
try:
if params[param]["type"] == "date":
type = date
metavar = "datetime"
try:
params = {}
# First grab all parameters name
for param in reader.items("parameters"):
cvalue = reader.get("parameters", param[0])
cparam = param[0].split(".")[0]
ckey = param[0].split(".")[1]
if not params.has_key(cparam):
params[cparam] = {ckey: cvalue}
else:
type = eval(params[param]["type"])
metavar = params[param]["type"]
except:
type = types.StringType
metavar = "str"
try: required = params[param]["required"].lower() in ("yes", "y", "true", "t", "1")
except: required = False
try: action = params[param]["action"]
except: action = "store"
try: choices = params[param]["choices"].split("|")
except: choices = None
oparam = Parameter(name=name, flag=flag, help=help, default=default,
type=type, required=required, metavar=metavar,
action=action, choices=choices)
parameters.append(oparam)
#except:
# pass
params[cparam][ckey] = cvalue
# Then build params
for param in params:
name = params[param]["name"]
flag = params[param]["flag"]
help = params[param]["help"]
try: default = params[param]["default"]
except: default = None
# handle type values
try:
if params[param]["type"] == "date":
type = date
metavar = "datetime"
else:
type = eval(params[param]["type"])
metavar = params[param]["type"]
except:
type = types.StringType
metavar = "str"
try: required = params[param]["required"].lower() in ("yes", "y", "true", "t", "1")
except: required = False
try: action = params[param]["action"]
except: action = "store"
try: choices = params[param]["choices"].split("|")
except: choices = None
oparam = Parameter(name=name, flag=flag, help=help, default=default,
type=type, required=required, metavar=metavar,
action=action, choices=choices)
parameters.append(oparam)
except:
pass
return [reader.get("global", "name"),
reader.get("global", "description"),
parameters]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment