Compare commits
No commits in common. "459806683a0bcadb65d34d3cd8526ac978e62887" and "6df70899006b63735b73df00f9f5096e81ecf37f" have entirely different histories.
459806683a
...
6df7089900
@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import requests
|
||||
from singleton import Singleton
|
||||
|
||||
"""
|
||||
Communicator module
|
||||
@ -12,10 +11,15 @@ __copyright__ = "Copyright 2020, GoldenPogácsa Team"
|
||||
__module_name__ = "messagesender"
|
||||
__version__text__ = "1"
|
||||
|
||||
class Communicator(Singleton):
|
||||
class Communicator:
|
||||
"""
|
||||
Class handling low level communication with consumers.
|
||||
"""
|
||||
def __init__(self):
|
||||
"""
|
||||
Initalize class
|
||||
"""
|
||||
pass
|
||||
|
||||
def sendmessage(self, message: str) -> None:
|
||||
"""
|
||||
|
30
singleton.py
30
singleton.py
@ -1,30 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Singleton meta module
|
||||
"""
|
||||
|
||||
__author__ = "@tormakris"
|
||||
__copyright__ = "Copyright 2020, GoldenPogácsa Team"
|
||||
__module_name__ = "singleton"
|
||||
__version__text__ = "1"
|
||||
|
||||
|
||||
class Singleton(object):
|
||||
"""
|
||||
Singleton metaclass
|
||||
"""
|
||||
_instances = {}
|
||||
|
||||
def __new__(class_, *args, **kwargs):
|
||||
"""
|
||||
New
|
||||
:param args:
|
||||
:param kwargs:
|
||||
:return:
|
||||
"""
|
||||
if class_ not in class_._instances:
|
||||
class_._instances[class_] = super(
|
||||
Singleton, class_).__new__(
|
||||
class_, *args, **kwargs)
|
||||
return class_._instances[class_]
|
Reference in New Issue
Block a user