Parse [CONTROLS]
This commit is contained in:
@@ -24,3 +24,19 @@ def set_control_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
||||
|
||||
def set_control(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
return execute_command(name, set_control_cache(name, cs))
|
||||
|
||||
|
||||
class InpControl:
|
||||
def __init__(self, section) -> None:
|
||||
self.control = '\n'.join(section)
|
||||
|
||||
|
||||
def inp_in_control(section: list[str]) -> ChangeSet:
|
||||
obj = InpControl(section)
|
||||
cs = ChangeSet({'operation' : API_UPDATE, 'type': 'control', 'control' : obj.control})
|
||||
return cs
|
||||
|
||||
|
||||
def inp_out_control(name: str) -> list[str]:
|
||||
obj = str(get_control(name)['control'])
|
||||
return obj.split('\n')
|
||||
|
||||
Reference in New Issue
Block a user