fix: user_datas => user_data
This commit is contained in:
parent
636cd59e7a
commit
1f537963df
1 changed files with 9 additions and 8 deletions
|
|
@ -15,11 +15,11 @@ GNU General Public License for more details.
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with Mtools. If not, see <http://www.gnu.org/licenses/>.
|
along with Mtools. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
from rougail.user_datas import UserDatas
|
from rougail.user_data import UserData
|
||||||
|
|
||||||
|
|
||||||
def load(rougailconfig: "RougailConfig",
|
def load(rougailconfig: "RougailConfig",
|
||||||
yaml_file: str=None,
|
yaml_files: list[str]=None,
|
||||||
env_prefix: str=None,
|
env_prefix: str=None,
|
||||||
commandline: bool=False,
|
commandline: bool=False,
|
||||||
_arguments=None,
|
_arguments=None,
|
||||||
|
|
@ -31,14 +31,15 @@ def load(rougailconfig: "RougailConfig",
|
||||||
cmd_config = rougailconfig.config
|
cmd_config = rougailconfig.config
|
||||||
origin_prop = cmd_config.property.exportation()
|
origin_prop = cmd_config.property.exportation()
|
||||||
cmd_config.property.read_write()
|
cmd_config.property.read_write()
|
||||||
user_datas = []
|
user_data = []
|
||||||
if yaml_file:
|
if yaml_files:
|
||||||
user_datas.extend(from_yaml(cmd_config, yaml_file))
|
for yaml_file in yaml_files:
|
||||||
|
user_data.extend(from_yaml(cmd_config, yaml_file))
|
||||||
if env_prefix:
|
if env_prefix:
|
||||||
user_datas.extend(from_env(cmd_config, env_prefix))
|
user_data.extend(from_env(cmd_config, env_prefix))
|
||||||
if commandline:
|
if commandline:
|
||||||
user_datas.extend(from_cmdline(cmd_config, _arguments, _add_help))
|
user_data.extend(from_cmdline(cmd_config, _arguments, _add_help))
|
||||||
user_data = UserDatas(cmd_config).user_datas(user_datas)
|
user_data = UserData(cmd_config).user_data(user_data)
|
||||||
cmd_config.property.importation(origin_prop)
|
cmd_config.property.importation(origin_prop)
|
||||||
return user_data
|
return user_data
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue