def init_meta_handler(**kwargs): import conf from django.conf import settings from xadrpy.utils.imports import get_installed_apps_module, get_class for conf_module in get_installed_apps_module("conf"): conf.META_HANDLER = getattr(conf_module, "META_HANDLER", conf.META_HANDLER) conf.META_HANDLER = getattr(settings, "META_HANDLER", conf.META_HANDLER) conf.META_HANDLER_CLS = get_class(conf.META_HANDLER)
def load(self): for theme in getattr(settings, "THEMES", ()): self.load_theme(libs.get_theme_config_over_default(theme)) for library in getattr(settings, "LIBRARIES", ()): self.load_library(libs.get_library_config_over_default(library)) for conf_module in get_installed_apps_module("conf"): for theme in getattr(conf_module, "THEMES", ()): self.load_theme(libs.get_theme_config_over_default(theme)) for library in getattr(conf_module, "LIBRARIES", ()): self.load_library(libs.get_library_config_over_default(library))
def autodiscover(): import logging from xadrpy.utils.signals import autodiscover_signal from xadrpy.utils.imports import get_installed_apps_module from django.conf import settings from django.utils.importlib import import_module logger = logging.getLogger("xadrpy.autodiscover") for xtensions in get_installed_apps_module("xtensions"): logger.debug("%s loaded.", xtensions.__name__) if hasattr(settings, "XTENSIONS"): xtensions = import_module(getattr(settings, "XTENSIONS")) logger.debug("%s loaded.", xtensions.__name__) for receiver, response in autodiscover_signal.send_robust(None): name = "%s.%s(%s)" % (receiver.__module__, receiver.__name__, ", ".join(receiver.__code__.co_varnames[:receiver.__code__.co_argcount])) if isinstance(response, Exception): exception_name = "%s.%s" % (response.__class__.__module__,response.__class__.__name__) logger.error("%s ERROR: %s(%s)", name, exception_name , response) else: logger.debug("%s success", name)
def init_meta_handler(**kwargs): for conf_module in get_installed_apps_module("conf"): conf.META_HANDLER = getattr(conf_module, "META_HANDLER", conf.META_HANDLER) conf.META_HANDLER = getattr(settings, "META_HANDLER", conf.META_HANDLER) conf.META_HANDLER_CLS = get_class(conf.META_HANDLER)