/
creator
/
ecstasy
Обзор
Документация
Войти
/
creator
/
ecstasy
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
devicemanager/remote/__init__.py
22 строки
572 B
irudenko
v 16.0.7
26 июл 2023, 11:10
26 июл 2023, 11:10
423fc17
Код
Авторство
О чём код?
from typing import Type from django.conf import settings from django.utils.module_loading import import_string from .connector import RemoteDevice class _DeviceRemoteConnector: def __init__(self): self._connector_class = RemoteDevice def set_connector(self, from_string: str): self._connector_class = import_string(from_string) @property def create(self) -> Type[RemoteDevice]: return self._connector_class remote_connector = _DeviceRemoteConnector() remote_connector.set_connector(from_string=settings.REMOTE_DEVICE_CLASS)