Remove old inp in routine

This commit is contained in:
WQY\qiong
2023-03-21 21:18:53 +08:00
parent 8681a56ed7
commit 9f9d3227b9
28 changed files with 83 additions and 642 deletions

View File

@@ -99,32 +99,7 @@ def delete_label(name: str, cs: ChangeSet) -> ChangeSet:
return execute_command(name, delete_label_cmd(name, cs))
class InpLabel:
def __init__(self, line: str) -> None:
tokens = line.split()
num = len(tokens)
has_desc = tokens[-1].startswith(';')
num_without_desc = (num - 1) if has_desc else num
self.x = float(tokens[0])
self.y = float(tokens[1])
self.label = str(tokens[2])
self.node = str(tokens[3]) if num >= 4 else None
def inp_in_label(section: list[str]) -> ChangeSet:
cs = ChangeSet()
for s in section:
# skip comment
if s.startswith(';'):
continue
obj = InpLabel(s)
cs.append(g_add_prefix | {'type': 'label', 'x': obj.x, 'y': obj.y, 'label': obj.label, 'node': obj.node})
return cs
def inp_in_label_new(line: str) -> str:
def inp_in_label(line: str) -> str:
tokens = line.split()
num = len(tokens)