1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 00:28:20 +08:00

Upd: Research patches from azur-stats-server

(cherry picked from commit f3428c8a0f19570536e20ea54be41f481a5408db)
This commit is contained in:
LmeSzinc
2022-08-07 17:44:56 +08:00
parent f7ecde114c
commit 5e962e8948
5 changed files with 67 additions and 12 deletions

View File

@@ -81,16 +81,19 @@ class Resource:
logger.info(f'{obj}: {key}')
@staticmethod
def parse_property(data):
def parse_property(data, s=None):
"""
Parse properties of Button or Template object input.
Such as `area`, `color` and `button`.
Args:
data: Dict or str
s (str): Load from given a server or load from global attribute `server.server`
"""
if s is None:
s = server.server
if isinstance(data, dict):
return data[server.server]
return data[s]
else:
return data