diff --git a/linspector/model.py b/linspector/model.py deleted file mode 100644 index 7e682cc..0000000 --- a/linspector/model.py +++ /dev/null @@ -1,14 +0,0 @@ -""" -This file is part of Linspector (https://linspector.org/) -Copyright (c) 2013-2023 Johannes Findeisen . All Rights Reserved. -See LICENSE. -""" - -# This class can maybe be used for a general data model for Linspector data processing. currently -# the is no use for it and no place known where it could be used with sense. -class Model: - - def __init__(self, configuration, environment, log): - self._configuration = configuration - self._environment = environment - self._log = log diff --git a/linspector/singleton.py b/linspector/singleton.py deleted file mode 100644 index b98ecbf..0000000 --- a/linspector/singleton.py +++ /dev/null @@ -1,48 +0,0 @@ -""" -This file is part of Linspector (https://linspector.org/) -Copyright (c) 2013-2023 Johannes Findeisen . All Rights Reserved. -See LICENSE. -""" - -# see http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern - - -class Singleton: - """ - A non-thread-safe helper class to ease implementing singletons. - This should be used as a decorator -- not a metaclass -- to the - class that should be a singleton. - - The decorated class can define one `__init__` function that - takes only the `self` argument. Other than that, there are - no restrictions that apply to the decorated class. - - To get the singleton instance, use the `Instance` method. Trying - to use `_call_` will result in a `TypeError` being raised. - - Limitations: The decorated class cannot be inherited from. - - """ - - def __init__(self, decorated): - self._decorated = decorated - self._instance = None - - def instance(self): - """ - Returns the singleton instance. Upon its first call, it creates a - new instance of the decorated class and calls its `__init__` method. - On all subsequent calls, the already created instance is returned. - - """ - try: - return self._instance - except AttributeError: - self._instance = self._decorated() - return self._instance - - def _call_(self): - raise TypeError('Singletons must be accessed through `Instance()`.') - - def _instancecheck_(self, inst): - return isinstance(inst, self._decorated)