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


Python SettingsBase.commit_settings方法代码示例

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


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

示例1: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:29,代码来源:timing_service.py

示例2: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:29,代码来源:autotap_ldvds.py

示例3: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:28,代码来源:xbee_watchport_clean.py

示例4: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:9,代码来源:console.py

示例5: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:32,代码来源:digi_temp.py

示例6: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:37,代码来源:mist_away_web_service.py

示例7: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:SmartOES,代码行数:12,代码来源:hl_main.py

示例8: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:12,代码来源:simple_logger.py

示例9: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:nikolaijivkov,项目名称:Cndep_Rest_Service__iDigi_Dia,代码行数:13,代码来源:udp_transfer_device.py

示例10: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:13,代码来源:null_service.py

示例11: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:15,代码来源:web.py

示例12: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:15,代码来源:tank_kit_presentation.py

示例13: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:15,代码来源:channel_viewer.py

示例14: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:17,代码来源:subtotal.py

示例15: apply_settings

# 需要导入模块: from settings.settings_base import SettingsBase [as 别名]
# 或者: from settings.settings_base.SettingsBase import commit_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:
            print "%s: Settings rejected/not found: %s %s" % \
                (self.show_name, rejected, not_found)

        else:
            SettingsBase.commit_settings(self, accepted)
            # print "%s: Settings accepted: %s" % (self.show_name, accepted)

        return (accepted, rejected, not_found)
开发者ID:Lewiswight,项目名称:4CT-GW--master,代码行数:18,代码来源:digitallatch.py


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