Support inp in coord, vertex, label
This commit is contained in:
@@ -124,6 +124,22 @@ def inp_in_label(section: list[str]) -> ChangeSet:
|
||||
return cs
|
||||
|
||||
|
||||
def inp_in_label_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
|
||||
|
||||
x = float(tokens[0])
|
||||
y = float(tokens[1])
|
||||
label = str(tokens[2])
|
||||
node = str(tokens[3]) if num >= 4 else None
|
||||
node = f"'{node}'" if node != None else 'null'
|
||||
|
||||
write(name, f"insert into labels (x, y, label, node) values ({x}, {y}, '{label}', {node});")
|
||||
|
||||
|
||||
def inp_out_label(name: str) -> list[str]:
|
||||
lines = []
|
||||
objs = read_all(name, 'select * from labels')
|
||||
|
||||
Reference in New Issue
Block a user