本文整理汇总了Python中settings.settings_base.SettingsBase.get_pending_setting方法的典型用法代码示例。如果您正苦于以下问题:Python SettingsBase.get_pending_setting方法的具体用法?Python SettingsBase.get_pending_setting怎么用?Python SettingsBase.get_pending_setting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings.settings_base.SettingsBase
的用法示例。
在下文中一共展示了SettingsBase.get_pending_setting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _reenumerate_services
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import get_pending_setting [as 别名]
def _reenumerate_services(self):
"""
Starts new services found in the pending setting registry's
"instance_list" setting.
If a new service is found it determines which driver is needed
and loads the driver dynamically if it has not been loaded already.
The instance is then created and started.
This function does not yet handle the dynamic stopping of system
services.
"""
try:
services = SettingsBase.get_pending_setting(self, "instance_list")
except:
# no instances found
return
service_names = set()
for service in services:
if "driver" in service and "name" in service:
if service['name'] in service_names:
self.__tracer.error("Duplicate item: %s", service['name'])
raise KeyError
if not self._service_loaded(service["driver"]):
self.service_load(service["driver"])
if not self.instance_exists(service["name"]):
self.instance_new(service["driver"], service["name"])
self.instance_start(service["name"])
service_names.add(service['name'])