From 17b17d3e23945935e1bc279cf5b9268ddddf4d79 Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 10 Sep 2024 09:57:53 +0200 Subject: [PATCH] cleaning --- src/rougail/user-data-environment/data.py | 32 +++++------------------ 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/src/rougail/user-data-environment/data.py b/src/rougail/user-data-environment/data.py index bb6c377..f1d746e 100644 --- a/src/rougail/user-data-environment/data.py +++ b/src/rougail/user-data-environment/data.py @@ -49,33 +49,13 @@ class RougailUserDataEnvironment: else: self.errors = [] self.warnings = [] - # this variable will be used for generating warnings + # this variable will be used for generating warnings # about unused ROUGAIL_ environment variables - self.unused_environment_var = get_rougail_environment_var() + self.unused_environment_var = get_rougail_environment_var() def run(self): self.config.property.read_write() - if self.rougailconfig['environment.mandatory']: - current_titles = [] - while True: - mandatories = self.config.value.mandatory() - if not mandatories: - break - mandatory = mandatories[0] - path = mandatory.path() - if '.' in path: - current_config = self.config - for idx, p in enumerate(path.split('.')[0:-1]): - current_config = current_config.option(p) - if idx < len(current_titles): - if current_titles[idx] == p: - continue - current_titles = current_titles[0:idx] - current_titles.append(p) - self.print(current_config.description(), idx) - self.display_environment(mandatory) - else: - self.parse(self.config) + self.parse(self.config) self.config.property.read_only() # if there are unused environment variables if len(self.unused_environment_var): @@ -96,14 +76,14 @@ class RougailUserDataEnvironment: # 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") - # + # rougail_environment_var = get_rougail_environment_var() option_name = option.path() - # this is used only for warning purposes + # this is used only for warning purposes self.unused_environment_var.remove(option_name) # let's parse the environment variables values if option_name in rougail_environment_var: - if ismulti: + if ismulti: 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(",")