Skip to content

Instantly share code, notes, and snippets.

@jsam
Created May 22, 2023 10:54
Show Gist options
  • Save jsam/e70176eb4e0dca2da7067063be049224 to your computer and use it in GitHub Desktop.
Save jsam/e70176eb4e0dca2da7067063be049224 to your computer and use it in GitHub Desktop.
__init__.py
"""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