From 99679b80b2e294a1715e556cd6f324f942ce1fa7 Mon Sep 17 00:00:00 2001 From: Novecento <61213759+Novecento99@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:24:04 +0200 Subject: [PATCH] better way to parse --- snap7/util/db.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/snap7/util/db.py b/snap7/util/db.py index 417f302d..bebe4ac4 100644 --- a/snap7/util/db.py +++ b/snap7/util/db.py @@ -152,12 +152,7 @@ def parse_specification(db_specification: str) -> Dict[str, Any]: for line in db_specification.split("\n"): if line and not line.lstrip().startswith("#"): - parsed_text = line.lstrip().split("#")[0].split() - - index = parsed_text[0] - _type = parsed_text[-1] - var_name_list = parsed_text[1:-1] - var_name = ''.join(var_name_list) + index, *var_name, _type = line.lstrip().split("#")[0].split() parsed_db_specification[var_name] = (index, _type)