Parse [BACKDROP]

This commit is contained in:
WQY\qiong
2022-11-17 18:34:16 +08:00
parent b2d0a727d2
commit b97d795484

View File

@@ -24,3 +24,19 @@ def set_backdrop_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
def set_backdrop(name: str, cs: ChangeSet) -> ChangeSet:
return execute_command(name, set_backdrop_cache(name, cs))
class InpBackdrop:
def __init__(self, section) -> None:
self.value = '\n'.join(section)
def inp_in_backdrop(section: list[str]) -> ChangeSet:
obj = InpBackdrop(section)
cs = ChangeSet(g_update_prefix | {'type': 'backdrop', 'content' : obj.value})
return cs
def inp_out_backdrop(name: str) -> list[str]:
obj = str(get_backdrop(name)['content'])
return obj.split('\n')