From ba6aee632254da250b5f93d13405ae6aeacde922 Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 24 Jan 2024 02:02:46 +0100 Subject: Resetting SQD object values each time their read from file --- squaredeal/sqd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/squaredeal/sqd.py b/squaredeal/sqd.py index d80c3e0..3de3f34 100644 --- a/squaredeal/sqd.py +++ b/squaredeal/sqd.py @@ -57,6 +57,9 @@ class SQDPhase(object): class SQD(object): def __init__(self): + self._init_values() + + def _init_values(self): self.name = '' self.delayed_info = '' self.delayed_value = '' @@ -68,6 +71,7 @@ class SQD(object): def fromfile(self, sqdpath, sqkpath=None, encoding='utf-8'): with open(sqdpath, encoding=encoding) as sqdfile: contents = [line.strip() for line in sqdfile.readlines()] + self._init_values() for idx, line in enumerate(contents): if line.startswith('#'): continue -- cgit v1.2.3