refactor: remove clean up function for Adaptor + make adaptor attributes accessible directly
This commit is contained in:
+5
-9
@@ -185,15 +185,11 @@ class Adaptor(SelectorsGeneration):
|
|||||||
else {}
|
else {}
|
||||||
)
|
)
|
||||||
|
|
||||||
def __del__(self):
|
def __getitem__(self, key: str) -> TextHandler:
|
||||||
"""Ensure cleanup happens"""
|
return self.attrib[key]
|
||||||
if hasattr(self, "_storage") and self._storage:
|
|
||||||
try:
|
def __contains__(self, key: str) -> bool:
|
||||||
self._storage.close()
|
return key in self.attrib
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
finally:
|
|
||||||
self._storage = None
|
|
||||||
|
|
||||||
# Node functionalities, I wanted to move to a separate Mixin class, but it had a slight impact on performance
|
# Node functionalities, I wanted to move to a separate Mixin class, but it had a slight impact on performance
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user