add multi parsing

This commit is contained in:
gwen 2024-09-09 11:39:49 +02:00
parent d4b551f2ca
commit 7965c53ab2

View file

@ -19,6 +19,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
""" """
from .helper import get_rougail_environment_var, get_rougail_environment_dict
from rougail.object_model import CONVERT_OPTION from rougail.object_model import CONVERT_OPTION
from rougail.config import RougailConfig from rougail.config import RougailConfig
from tiramisu.error import ValueOptionError from tiramisu.error import ValueOptionError
@ -88,20 +90,18 @@ class RougailUserDataEnvironment:
type_obj = None type_obj = None
type_obj = CONVERT_OPTION.get(option_type, {}).get("func") type_obj = CONVERT_OPTION.get(option_type, {}).get("func")
from .helper import get_rougail_environment_var, get_rougail_environment_dict # 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:
option.value.set(get_rougail_environment_dict()[option_name]) if ismulti:
#option.value.set(["78", "52"]) pass
# TODO option_bash_value = get_rougail_environment_dict()[option_name]
# - tester les var commençant par ROUGAIL_ option_value = option_bash_value.split(",")
# 'ROUGAIL_' option.value.set(option_value)
# tester si c'est une multi else:
# le CONVERT_TYPE ne marchera pas si c'est une multi option.value.set(get_rougail_environment_dict()[option_name])
# récupérer le nam de l'option pour voir si elle est dans l'env
#RougailValidator.option = option #RougailValidator.option = option
#RougailValidator.option_type = {'type': option_type, #RougailValidator.option_type = {'type': option_type,