Created
May 22, 2023 10:54
-
-
Save jsam/e70176eb4e0dca2da7067063be049224 to your computer and use it in GitHub Desktop.
__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Melon Translate client.""" | |
class _InitializeModule: | |
_instance = None | |
def __new__(cls, *args, **kwargs): | |
if not cls._instance: | |
cls._instance = super().__new__(cls, *args, **kwargs) | |
return cls._instance | |
def __init__(self): | |
self.setup_lock() | |
self.setup_models() | |
def setup_lock(self): | |
.... | |
def setup_models(self): | |
Migrator.run() | |
... | |
_ = _InitializeModule() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment