cfg parser update 1

This commit is contained in:
Rekku 2024-09-12 16:48:16 +01:00
parent 6b05cd0e35
commit ec0a787166
2 changed files with 7 additions and 3 deletions

View file

@ -41,4 +41,8 @@ func disable_global(button: Button) -> void:
change_global(result)
func change_global(parameters: Array) -> void:
print (parameters)
parameters.push_front("build_preset_config")
class_functions.logger("d", "Running: %s" % var_to_str(parameters))
var result: Dictionary
result = await class_functions.run_thread_command(class_functions.wrapper_command, parameters, false)
class_functions.logger("d", "Exit code: %s" % result["exit_code"])

View file

@ -318,7 +318,7 @@ func write_cfg_file(file_path: String, lines: Array, changes: Dictionary) -> voi
func change_cfg_value(file_path: String, key: String, section: String, new_value: String) -> Array:
var lines: Array = read_cfg_file(file_path)
var args: Array =[key, section, new_value]
var parameters: Array =[key, section]
var changes: Dictionary = {}
if section in changes:
changes[section][key] = new_value
@ -326,4 +326,4 @@ func change_cfg_value(file_path: String, key: String, section: String, new_value
changes[section] = {key: new_value}
class_functions.logger("d", "No Change: Key: %s Section %s New Value: %s" % [key, section, new_value])
write_cfg_file(file_path, lines, changes)
return args
return parameters