From 79550303fe25d8cbcfa34498d81587ca275f45af Mon Sep 17 00:00:00 2001 From: Julian Daube Date: Tue, 2 Jul 2019 14:47:36 +0200 Subject: [PATCH] structure, library: remove class elements --- gds/library.py | 17 +++++++++-------- gds/reader.py | 2 -- gds/structure.py | 19 ++++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/gds/library.py b/gds/library.py index 2889fda..4dc6261 100644 --- a/gds/library.py +++ b/gds/library.py @@ -3,17 +3,18 @@ from .elements import SRef from .reader import ProgressGetter class Library(object): - version = 0 - name = "NONAME" + def __init__(self): + self.version = 0 + self.name = "NONAME" - last_access = datetime.now() - last_mod = datetime.now() + self.last_access = datetime.now() + self.last_mod = datetime.now() - # unit setup - units_per_dbunit = 1 - meters_per_unit = 1 + # unit setup + self.units_per_dbunit = 1 + self.meters_per_unit = 1 - structures = {} + self.structures = {} class LinkError(Exception): element = None diff --git a/gds/reader.py b/gds/reader.py index 594cf62..9cd9946 100644 --- a/gds/reader.py +++ b/gds/reader.py @@ -16,8 +16,6 @@ class ProgressGetter(object, metaclass=abc.ABCMeta): raise NotImplementedError("getting the progess is not implemented") class Reader(ProgressGetter): - # statistics - total = 0 @property def current(self): return float(self.stream.tell()) diff --git a/gds/structure.py b/gds/structure.py index c6b0a0c..50f9b70 100644 --- a/gds/structure.py +++ b/gds/structure.py @@ -1,13 +1,14 @@ from datetime import datetime class Structure(object): - # metainfo - creation_date = datetime.now() - last_mod = datetime.now() - name = "NONAME" + def __init__(self): + # metainfo + self.creation_date = datetime.now() + self.last_mod = datetime.now() + self.name = "NONAME" - # contains all the low level elements - elements = [] - - # contains all sref and aref elements - references = [] \ No newline at end of file + # contains all the low level elements + self.elements = [] + + # contains all sref and aref elements + self.references = [] \ No newline at end of file