Ejemplo n.º 1
0
def init_theme_loaders(**kwargs):
    import loaders
    find_template("xadrpy/themes/base.html") #Hack: init template loaders
    for loader_name in conf.THEME_LOADERS:
        theme_loader_cls = get_class(loader_name, loaders.ThemeLoader)
        theme_loader = theme_loader_cls()
        theme_loader.load()
Ejemplo n.º 2
0
 def get_instance(self, obj):
     cls = self.get_class(obj)
     if not cls:
         return None
     if isinstance(cls, basestring):
         cls = get_class(cls)
     opts = self.get_opts(obj) or {}
     return self.create_instance(obj, cls, opts)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
 def init(self, **kwargs):
     self.stdout.write("Collecting themes...\n")
     import loaders, time
     try:
         find_template("xadrpy/themes/base.html") #Hack: init template loaders
         for loader_name in conf.THEME_LOADERS:
             theme_loader_cls = get_class(loader_name, loaders.ThemeLoader)
             theme_loader = theme_loader_cls()
             theme_loader.load()
     except Exception, e:
         logger.exception("Theme loading failed: %s", e)
         return
Ejemplo n.º 5
0
 def get_vtype_class(self):
     if hasattr(self, "_vtype_object"):
         return self._vtype_object
     self._vtype_object = get_class(self.attribute_type.vtype)(self) 
     return self._vtype_object
Ejemplo n.º 6
0
 def get_plugin_cls(self):
     return get_class(self.plugin)
Ejemplo n.º 7
0
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)