コード例 #1
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)
コード例 #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)
コード例 #3
0
ファイル: __init__.py プロジェクト: orb-framework/pyramid_orb
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)
コード例 #4
0
ファイル: __init__.py プロジェクト: charblanc/pyramid_orb
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)
コード例 #5
0
 def _initAddons(cls, recurse=True):
     """
     Initializes the addons for this manager.
     """
     for addon_module in cls.addonModules(recurse):
         projex.importmodules(addon_module)
コード例 #6
0
ファイル: xexporter.py プロジェクト: tafify/projexui
 def init():
     """
     Initializes the exporter system.
     """
     projex.importmodules(__plugins__)
コード例 #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__)