non string type multi variable ready for bash export
This commit is contained in:
parent
7965c53ab2
commit
5175ebca19
1 changed files with 15 additions and 7 deletions
|
@ -88,20 +88,28 @@ class RougailUserDataEnvironment:
|
||||||
default = option.value.get()
|
default = option.value.get()
|
||||||
ismulti = option.ismulti()
|
ismulti = option.ismulti()
|
||||||
type_obj = None
|
type_obj = None
|
||||||
|
# here we retrieve the conversion func of the considered type
|
||||||
|
# carefull, it could be None -> in this case, do nothing
|
||||||
type_obj = CONVERT_OPTION.get(option_type, {}).get("func")
|
type_obj = CONVERT_OPTION.get(option_type, {}).get("func")
|
||||||
|
#
|
||||||
# print(CONVERT_OPTION)
|
|
||||||
|
|
||||||
rougail_environment_var = get_rougail_environment_var()
|
rougail_environment_var = get_rougail_environment_var()
|
||||||
option_name = option.path()
|
option_name = option.path()
|
||||||
if option_name in rougail_environment_var:
|
if option_name in rougail_environment_var:
|
||||||
if ismulti:
|
if ismulti:
|
||||||
pass
|
|
||||||
option_bash_value = get_rougail_environment_dict()[option_name]
|
option_bash_value = get_rougail_environment_dict()[option_name]
|
||||||
|
# here we expect the bash option value of a multi to be coma separated:
|
||||||
option_value = option_bash_value.split(",")
|
option_value = option_bash_value.split(",")
|
||||||
|
if type_obj is not None:
|
||||||
|
option_value_typed = [type_obj(opt) for opt in option_value]
|
||||||
|
option.value.set(option_value_typed)
|
||||||
|
else:
|
||||||
option.value.set(option_value)
|
option.value.set(option_value)
|
||||||
else:
|
else:
|
||||||
option.value.set(get_rougail_environment_dict()[option_name])
|
option_bash_value = get_rougail_environment_dict()[option_name]
|
||||||
|
if type_obj is not None:
|
||||||
|
option.value.set(type_obj(option_bash_value))
|
||||||
|
else:
|
||||||
|
option.value.set(option_bash_value)
|
||||||
|
|
||||||
#RougailValidator.option = option
|
#RougailValidator.option = option
|
||||||
#RougailValidator.option_type = {'type': option_type,
|
#RougailValidator.option_type = {'type': option_type,
|
||||||
|
|
Loading…
Reference in a new issue