mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-25 15:05:49 +00:00
reformat lines
This commit is contained in:
parent
94be1dda8c
commit
e168d97332
@ -4,13 +4,16 @@ import os
|
|||||||
from planetmint.log import DEFAULT_LOGGING_CONFIG as log_config
|
from planetmint.log import DEFAULT_LOGGING_CONFIG as log_config
|
||||||
from planetmint.version import __version__ # noqa
|
from planetmint.version import __version__ # noqa
|
||||||
|
|
||||||
|
|
||||||
class Singleton(type):
|
class Singleton(type):
|
||||||
_instances = {}
|
_instances = {}
|
||||||
|
|
||||||
def __call__(cls, *args, **kwargs):
|
def __call__(cls, *args, **kwargs):
|
||||||
if cls not in cls._instances:
|
if cls not in cls._instances:
|
||||||
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
|
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
|
||||||
return cls._instances[cls]
|
return cls._instances[cls]
|
||||||
|
|
||||||
|
|
||||||
class Config(metaclass=Singleton):
|
class Config(metaclass=Singleton):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -116,7 +119,7 @@ class Config(metaclass=Singleton):
|
|||||||
# select the correct config defaults based on the backend
|
# select the correct config defaults based on the backend
|
||||||
self._private_real_config['database'] = self.__private_database_map[db]
|
self._private_real_config['database'] = self.__private_database_map[db]
|
||||||
|
|
||||||
def init_config(self, db ):
|
def init_config(self, db):
|
||||||
self._private_real_config = copy.deepcopy(self.__private_config)
|
self._private_real_config = copy.deepcopy(self.__private_config)
|
||||||
# select the correct config defaults based on the backend
|
# select the correct config defaults based on the backend
|
||||||
self._private_real_config['database'] = self.__private_database_map[db]
|
self._private_real_config['database'] = self.__private_database_map[db]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user