def init(self):
     """
     Initializes the plugins for this resource manager.
     """
     # import any compiled resource modules
     if not self._initialized:
         self._initialized = True
         wrap = projexui.qt.QT_WRAPPER.lower()
         ignore = lambda x: not x.split('.')[-1].startswith(wrap)
         projex.importmodules(self.plugins(), ignore=ignore)
Beispiel #2
0
 def init(self):
     """
     Initializes the plugins for this resource manager.
     """
     # import any compiled resource modules
     if not self._initialized:
         self._initialized = True
         wrap = projexui.qt.QT_WRAPPER.lower()
         ignore = lambda x: not x.split('.')[-1].startswith(wrap)
         projex.importmodules(self.plugins(), ignore=ignore)
Beispiel #3
0
def register(config, modules=None, scope=None):
    scope = scope or {}
    if modules:
        # import the database models
        projex.importmodules(modules, silent=False)

    # expose all of the models to the API
    for name, model in orb.system.models().items():
        scope[name] = model

        if getattr(model, '__resource__', False):
            config.registry.rest_api.register(model)
Beispiel #4
0
def register(config, modules=None, scope=None):
    scope = scope or {}
    if modules:
        # import the database models
        projex.importmodules(modules, silent=False)

    # expose all of the models to the API
    for name, model in orb.system.models().items():
        scope[name] = model

        if getattr(model, '__resource__', False):
            config.registry.rest_api.register(model)
Beispiel #5
0
 def _initAddons(cls, recurse=True):
     """
     Initializes the addons for this manager.
     """
     for addon_module in cls.addonModules(recurse):
         projex.importmodules(addon_module)
Beispiel #6
0
 def init():
     """
     Initializes the exporter system.
     """
     projex.importmodules(__plugins__)
Beispiel #7
0
        """
        Returns the value for the cached key for this instance.
        
        :return     <variant>
        """
        return default

    @staticmethod
    def create(timeout=0):
        """
        Creates a new data cache instance through the orb system manager.  To setup a factory, use
        `orb.system.setCacheFactory(factory)`

        :return     <orb.caching.DataCache>
        """
        factory = orb.system.cacheFactory()
        if factory:
            if isinstance(factory, orb.DataCache):
                return factory
            elif callable(factory):
                return factory(timeout)
            else:
                cls = DataCache.byName(factory)
                return cls(timeout)
        else:
            cls = DataCache.byName('Basic')
            return cls(timeout)

from orb.caching.backends import __plugins__
projex.importmodules(__plugins__)