本文整理汇总了Python中settings.settings_base.SettingsBase.verify_settings方法的典型用法代码示例。如果您正苦于以下问题:Python SettingsBase.verify_settings方法的具体用法?Python SettingsBase.verify_settings怎么用?Python SettingsBase.verify_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings.settings_base.SettingsBase
的用法示例。
在下文中一共展示了SettingsBase.verify_settings方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
"""\
Called when new configuration settings are available.
Must return tuple of three dictionaries: a dictionary of
accepted settings, a dictionary of rejected settings,
and a dictionary of required settings that were not
found.
"""
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
print "TimingService(%s) Settings rejected/not found: %s %s" % (
self.__name, rejected, not_found)
SettingsBase.commit_settings(self, accepted)
# Tear down and rebuild annotation system, this does mean that
# reconfiguration will cause a window where stale data will
# not be reported at the time where it technically becomes
# stale under either configuration necessarily.
self._destroy_timers()
self._create_timers()
self._enroll_channel_sources()
return (accepted, rejected, not_found)
示例2: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
# there were problems with settings, terminate early:
self.__tracer.error("Settings rejected/not found: %s %s",
rejected, not_found)
return (accepted, rejected, not_found)
# Walk each setting, and verify the physical channel type
# is the same type the user specified in their config.
for setting in accepted.copy():
if setting[0:7] == "channel":
try:
channel = setting[7]
operation = setting[9:]
type = digihw.get_channel_type(int(channel) - 1)
if type == self.IO_TYPE_ANALOG:
if operation != "mode":
raise ValueError, "Channel mode is not correct"
elif type == self.IO_TYPE_DIGITAL:
if operation != "dir" and operation != "source":
raise ValueError, "Channel mode is not correct"
else:
raise ValueError, "Channel mode is not correct"
except Exception, e:
self.__tracer.error("Unable to parse settings: %s", e)
rejected[setting] = accepted[setting]
del accepted[setting]
示例3: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
"""\
Called when new configuration settings are available.
Must return tuple of three dictionaries: a dictionary of
accepted settings, a dictionary of rejected settings,
and a dictionary of required settings that were not
found.
"""
try:
if not threading.Thread.isAlive(self):
return
except:
return
if 'update_rate' in accepted and \
accepted['update_rate'] > SHUTDOWN_WAIT:
self.__tracer.warning('Long update_rate setting may ' +
'interfere with shutdown of Dia.')
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
SettingsBase.commit_settings(self, accepted)
return (accepted, rejected, not_found)
示例4: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
# verify exclusive issues
if(accepted['poll_clean_minutes'] > 0):
# then we have exclusive issues to settle
if(accepted['sleep']):
# cannot sleep with clean_minutes active
print "XBeeWatchport: 'sleep' cannot be True if poll_clean_minutes is used."
rejected['sleep'] = accepted['sleep']
del accepted['sleep']
# over-ride / force sample_rate to match clean_minutes
accepted['sample_rate_ms'] = \
accepted['poll_clean_minutes'] * 60000
if len(rejected) or len(not_found):
# there were problems with settings, terminate early:
print "Settings rejected/not found: %s %s" % (rejected, not_found)
return (accepted, rejected, not_found)
SettingsBase.commit_settings(self, accepted)
return (accepted, rejected, not_found)
示例5: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
SettingsBase.commit_settings(self, accepted)
return (accepted, rejected, not_found)
示例6: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
# there were problems with settings, terminate early:
self.__tracer.error("Settings rejected/not found: %s %s",
rejected, not_found)
return (accepted, rejected, not_found)
# Verify that the sample predelay time when added to the awake time
# is not over 0xffff.
if accepted['sample_predelay'] + accepted['awake_time_ms'] > 0xffff:
self.__tracer.error("The awake_time_ms value (%d) " +
"and sample_predelay value (%d) " +
"when added together cannot exceed 65535.",
self.__name, accepted['sample_predelay'],
accepted['awake_time_ms'])
rejected['awake_time_ms'] = accepted['awake_time_ms']
del accepted['awake_time_ms']
rejected['sample_predelay'] = accepted['sample_predelay']
del accepted['sample_predelay']
return (accepted, rejected, not_found)
SettingsBase.commit_settings(self, accepted)
return (accepted, rejected, not_found)
示例7: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
# There were problems with settings, terminate early:
print "idigi_db (%s): Settings rejected/not found: %s %s" % \
(self.__name, rejected, not_found)
return (accepted, rejected, not_found)
# Verify that if we are on the Digi ConnectPort X3, that the user
# doesn't have the secure option set to True.
# If they do, we MUST bail here and also warn the user that the
# Digi ConnectPort X3 cannot do secure/encrypted idigi connections.
if accepted['secure'] == True and get_platform_name() == 'digix3':
print "idigi_db (%s): The Digi ConnectPort X3 product cannot " \
"do secure/encrypted connections to the iDigi Server. " \
"Please set the 'secure' option to False!" % \
(self.__name)
rejected['secure'] = accepted['secure']
del accepted['secure']
return (accepted, rejected, not_found)
SettingsBase.commit_settings(self, accepted)
# xbee_manager_name = SettingsBase.get_setting(self, "xbee_device_manager")
dm = self.__core.get_service("device_driver_manager")
self.__xbee_manager = dm.instance_get("xbee_device_manager")
self.__last_upload_time = 0
self.repeat()
return (accepted, rejected, not_found)
示例8: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
print "Settings rejected/not found: %s %s" % (rejected, not_found)
SettingsBase.commit_settings(self, accepted)
return (accepted, rejected, not_found)
示例9: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
self.__tracer.error("settings rejected/not found: %s/%s", rejected, not_found)
SettingsBase.commit_settings(self, accepted)
return (accepted, rejected, not_found)
示例10: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
# there were problems with settings, terminate early:
return (accepted, rejected, not_found)
SettingsBase.commit_settings(self, accepted)
return (accepted, rejected, not_found)
示例11: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
# there were problems with settings, terminate early:
self.__tracer.error("Settings rejected/not found: %s %s", \
rejected, not_found)
return (accepted, rejected, not_found)
SettingsBase.commit_settings(self, accepted)
return (accepted, rejected, not_found)
示例12: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
print "Settings rejected/not found: %s %s" % (rejected, not_found)
if accepted['page'].startswith('/'):
# trim leading / if present:
accepted['page'] = accepted['page'][1:]
SettingsBase.commit_settings(self, accepted)
return (accepted, rejected, not_found)
示例13: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
"""
Apply settings as they are defined by the configuration file.
"""
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
print "Settings rejected/not found: %s %s" % (rejected, not_found)
SettingsBase.commit_settings(self, accepted)
return (accepted, rejected, not_found)
示例14: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
""" Apply settings as they are defined by the configuration file """
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
print "Settings rejected/not found: %s %s" % (rejected, not_found)
self.__channels = accepted['channels']
self.__update_rate = accepted['update_rate']
SettingsBase.commit_settings(self, accepted)
return (accepted, rejected, not_found)
示例15: apply_settings
# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import verify_settings [as 别名]
def apply_settings(self):
"""Called when new configuration settings are available."""
SettingsBase.merge_settings(self)
accepted, rejected, not_found = SettingsBase.verify_settings(self)
if len(rejected) or len(not_found):
# there were problems with settings, terminate early:
self.__tracer.error("Settings rejected/not found: %s %s",
rejected, not_found)
else:
SettingsBase.commit_settings(self, accepted)
self.__tracer.debug("Settings accepted: %s", accepted)
return (accepted, rejected, not_found)