Support inp in tag, demand, status
This commit is contained in:
@@ -113,6 +113,21 @@ def inp_in_status(section: list[str]) -> ChangeSet:
|
||||
return cs
|
||||
|
||||
|
||||
def inp_in_status_new(name: str, line: str) -> None:
|
||||
tokens = line.split()
|
||||
|
||||
num = len(tokens)
|
||||
has_desc = tokens[-1].startswith(';')
|
||||
num_without_desc = (num - 1) if has_desc else num
|
||||
|
||||
link = str(tokens[0])
|
||||
value = tokens[1].upper()
|
||||
if value == LINK_STATUS_OPEN or value == LINK_STATUS_CLOSED or value == LINK_STATUS_ACTIVE:
|
||||
write(name, f"insert into status (link, status, setting) values ('{link}', '{value}', null);")
|
||||
else:
|
||||
write(name, f"insert into status (link, status, setting) values ('{link}', null, {float(value)});")
|
||||
|
||||
|
||||
def inp_out_status(name: str) -> list[str]:
|
||||
lines = []
|
||||
objs = read_all(name, 'select * from status')
|
||||
|
||||
Reference in New Issue
Block a user