Skip to content

Commit

Permalink
fix: the corrections are as follows (#523)
Browse files Browse the repository at this point in the history
1. simplify the import path for DB classes and DB_Row classes.
2. trim all leading whitespaces when splitting each line of the DB specification.
  • Loading branch information
kosncn authored Jul 4, 2024
1 parent 34cdcc3 commit 3752d51
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion snap7/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@
from typing import Any
from collections import OrderedDict

from .db import (
DB,
DB_Row,
)

from .setters import (
set_bool,
set_fstring,
Expand Down Expand Up @@ -187,7 +192,7 @@ def parse_specification(db_specification: str) -> OrderedDict[str, Any]:

for line in db_specification.split("\n"):
if line and not line.lstrip().startswith("#"):
index, var_name, _type = line.split("#")[0].split()
index, var_name, _type = line.lstrip().split("#")[0].split()
parsed_db_specification[var_name] = (index, _type)

return parsed_db_specification
Expand Down

0 comments on commit 3752d51

Please sign in to comment.