mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 02:48:23 +08:00
Upd: delete gg_handler
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
import typing as t
|
||||
|
||||
from deploy.Windows.utils import poor_yaml_read, poor_yaml_write, DEPLOY_TEMPLATE
|
||||
from deploy.utils import poor_yaml_read, poor_yaml_write, DEPLOY_TEMPLATE
|
||||
|
||||
"""
|
||||
Set config/deploy.yaml with commands like
|
||||
@@ -21,26 +21,17 @@ def get_args() -> t.Dict[str, str]:
|
||||
return args
|
||||
|
||||
|
||||
def config_set(modify: t.Dict[str, str], output='./config/deploy.yaml') -> t.Dict[str, str]:
|
||||
"""
|
||||
Args:
|
||||
modify: A dict of key-value in deploy.yaml
|
||||
output:
|
||||
|
||||
Returns:
|
||||
The updated key-value in deploy.yaml
|
||||
"""
|
||||
def config_set(output='./config/deploy.yaml'):
|
||||
data = poor_yaml_read(DEPLOY_TEMPLATE)
|
||||
data.update(poor_yaml_read(output))
|
||||
for k, v in modify.items():
|
||||
for k, v in get_args().items():
|
||||
if k in data:
|
||||
print(f'Key "{k}" set')
|
||||
print(f'{k} set')
|
||||
data[k] = v
|
||||
else:
|
||||
print(f'Key "{k}" not exist')
|
||||
print(f'{k} not exist')
|
||||
poor_yaml_write(data, file=output)
|
||||
return data
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
config_set(get_args())
|
||||
config_set()
|
||||
Reference in New Issue
Block a user