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)
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)
def _initAddons(cls, recurse=True): """ Initializes the addons for this manager. """ for addon_module in cls.addonModules(recurse): projex.importmodules(addon_module)
def init(): """ Initializes the exporter system. """ projex.importmodules(__plugins__)
""" 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__)