renamed package.

This commit is contained in:
tylerlaberge
2016-09-10 17:11:45 -04:00
parent 52ceb712d4
commit cee2bc400b
39 changed files with 23 additions and 23 deletions
+18
View File
@@ -0,0 +1,18 @@
class Singleton(type):
"""
Singleton Metaclass.
Enforces any object using this metaclass to only create a single instance.
External Singleton Pattern documentation: U{https://en.wikipedia.org/wiki/Singleton_pattern}
"""
__instance = None
def __call__(cls, *args, **kwargs):
"""
Override the __call__ method to make sure only one instance is created.
"""
if cls.__instance is None:
cls.__instance = type.__call__(cls, *args, **kwargs)
return cls.__instance