当前位置: 首页>>代码示例>>Python>>正文


Python Configuration.init_from_db方法代码示例

本文整理汇总了Python中configuration.Configuration.init_from_db方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.init_from_db方法的具体用法?Python Configuration.init_from_db怎么用?Python Configuration.init_from_db使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在configuration.Configuration的用法示例。


在下文中一共展示了Configuration.init_from_db方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from configuration import Configuration [as 别名]
# 或者: from configuration.Configuration import init_from_db [as 别名]
 def __init__(self, core_config):
     """
     Initialize configuration and database-connection
     """
     self.__dict__ = Core._borgmind
     if self.__dict__ == {}:
         c = Configuration(core_config)
         Database()
         c.init_from_db()
         
         self.response_body = []
         self.response_header = []
开发者ID:skarphed,项目名称:skarphed,代码行数:14,代码来源:core.py

示例2: Core

# 需要导入模块: from configuration import Configuration [as 别名]
# 或者: from configuration.Configuration import init_from_db [as 别名]
class Core(object):
    """
    The Core class is the interface to the world of Skarphed
    """
    def __init__(self, core_config):
        """
        Initialize configuration and database-connection
        """
        self._core_config = core_config

        self._configuration = Configuration(self)
        self._database = Database(self)
        self._configuration.init_from_db()
        self._user_manager = None
        self._permission_manager = None
        self._operation_manager = None
        self._module_manager = None
        self._session_manager = None
        self._css_manager = None
        self._action_manager = None
        self._binary_manager = None
        self._view_manager = None
        self._page_manager = None
        self._template_manager = None
        self._pki_manager = None
        self._poke_manager = None
        
        self.response_body = []
        self.response_header = []

    def get_core_config(self,obj):
        """
        Passes the core config on to the Configuration class.
        This is the only time in a skarphed lifetime, that this happens.
        """
        if obj.__class__.__name__ != "Configuration":
            raise CoreException(CoreException.get_msg(1))
        else:
            return self._core_config

    def get_configuration(self):
        """
        Returns the instance of Configuration
        """
        return self._configuration

    def get_db(self):
        return self._database

    def get_user_manager(self):
        if self._user_manager is None:
            self._user_manager = UserManager(self)
        return self._user_manager

    def get_permission_manager(self):
        if self._permission_manager is None:
            self._permission_manager = PermissionManager(self)
        return self._permission_manager

    def get_session_manager(self):
        if self._session_manager is None:
            self._session_manager = SessionManager(self)
        return self._session_manager

    def get_operation_manager(self):
        if self._operation_manager is None:
            self._operation_manager = OperationManager(self)
        return self._operation_manager

    def get_module_manager(self):
        if self._module_manager is None:
            self._module_manager = ModuleManager(self)
        return self._module_manager
     
    def get_css_manager(self):
        if self._css_manager is None:
            self._css_manager = CSSManager(self)
        return self._css_manager

    def get_action_manager(self):
        if self._action_manager is None:
            self._action_manager = ActionManager(self)
        return self._action_manager

    def get_binary_manager(self):
        if self._binary_manager is None:
            self._binary_manager = BinaryManager(self)
        return self._binary_manager

    def get_view_manager(self):
        if self._view_manager is None:
            self._view_manager = ViewManager(self)
        return self._view_manager

    def get_page_manager(self):
        if self._page_manager is None:
            self._page_manager = PageManager(self)
        return self._page_manager

    def get_template_manager(self):
#.........这里部分代码省略.........
开发者ID:joker234,项目名称:skarphed,代码行数:103,代码来源:core.py


注:本文中的configuration.Configuration.init_from_db方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。