Ejemplo n.º 1
0
def load_application(module, root, settings):
    # includeme function
    if hasattr(module, 'includeme'):
        lazy_apply(module.includeme, root, settings)
    # app_settings
    if hasattr(module, 'app_settings') and app_settings != module.app_settings:
        update_app_settings(module.app_settings)
    # services
    configure.load_all_configurations(root.config, module.__name__)
Ejemplo n.º 2
0
def load_application(module, root, settings):
    # includeme function
    if hasattr(module, 'includeme'):
        args = [root]
        if len(inspect.signature(module.includeme).parameters) == 2:
            args.append(settings)
        module.includeme(*args)
    # app_settings
    if hasattr(module, 'app_settings') and app_settings != module.app_settings:
        update_app_settings(module.app_settings)
    # services
    configure.load_all_configurations(root.config, module.__name__)
Ejemplo n.º 3
0
    def load_application(self, module):
        # includeme function
        if hasattr(module, 'includeme'):
            lazy_apply(module.includeme, self.root, self.settings)
        # app_settings
        if hasattr(module, 'app_settings') and app_settings != module.app_settings:
            update_app_settings(module.app_settings)

        # exclude configuration from sub packages that are registered
        # as applications
        excluded_modules = [
            module_name for module_name in
            set(self.applications) - set([module.__name__])
            if not module.__name__.startswith(module_name)]

        # services
        return configure.load_all_configurations(
            self.root.config, module.__name__, excluded_modules)
Ejemplo n.º 4
0
    def load_application(self, module):
        # includeme function
        if hasattr(module, "includeme"):
            lazy_apply(module.includeme, self.root, self.settings)
        # app_settings
        if hasattr(module,
                   "app_settings") and app_settings != module.app_settings:
            update_app_settings(module.app_settings)

        # exclude configuration from sub packages that are registered
        # as applications
        excluded_modules = [
            module_name
            for module_name in set(self.applications) - set([module.__name__])
            if not module.__name__.startswith(module_name)
        ] + [
            module_name for module_name in self.contrib_apps
            if module_name != module.__name__
        ]
        # services
        return configure.load_all_configurations(self.root.config,
                                                 module.__name__,
                                                 excluded_modules)