mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-25 07:25:38 +00:00
cfg parser update 1
This commit is contained in:
parent
6b05cd0e35
commit
ec0a787166
|
@ -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"])
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue