Implement CLI

This commit is contained in:
taizan-hokuto
2020-03-08 23:18:30 +09:00
parent af3b6d4271
commit 9d624f771a
17 changed files with 326 additions and 647 deletions

19
pytchat/cli/singleton.py Normal file
View File

@@ -0,0 +1,19 @@
'''
This modules refer to
Petter Kraabøl's Twitch-Chat-Downloader
https://github.com/PetterKraabol/Twitch-Chat-Downloader
(MIT License)
'''
class Singleton(type):
"""
Abstract class for singletons
"""
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super().__call__(*args, **kwargs)
return cls._instances[cls]
def get_instance(cls, *args, **kwargs):
cls.__call__(*args, **kwargs)