Parse [REACTIONS], only support inp out

This commit is contained in:
WQY\qiong
2022-11-14 21:37:49 +08:00
parent 2f8f7c4918
commit 1865d111df

View File

@@ -60,15 +60,15 @@ def set_reaction(name: str, cs: ChangeSet) -> ChangeSet:
return execute_command(name, set_reaction_cache(name, cs)) return execute_command(name, set_reaction_cache(name, cs))
def inp_in_reaction(section: list[str]) -> ChangeSet: # def inp_in_reaction(section: list[str]) -> ChangeSet:
cs = g_update_prefix | { 'type' : 'reaction' } # cs = g_update_prefix | { 'type' : 'reaction' }
for s in section: # for s in section:
line = s.upper().strip() # line = s.upper().strip()
for key in get_reaction_schema('').keys(): # for key in get_reaction_schema('').keys():
if line.startswith(key): # if line.startswith(key):
value = line.removeprefix(key).strip() # value = line.removeprefix(key).strip()
cs |= { key : value } # cs |= { key : value }
return ChangeSet(cs) # return ChangeSet(cs)
def inp_out_reaction(name: str) -> list[str]: def inp_out_reaction(name: str) -> list[str]: