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


Python Settings.contains方法代码示例

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


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

示例1: app_startup

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import contains [as 别名]
 def app_startup(self):
     """
     Do a couple of things when the app starts up. In this particular case
     we want to check if we have the old "Use Phonon" setting, and convert
     it to "enable Phonon" and "make it the first one in the list".
     """
     Plugin.app_startup(self)
     settings = Settings()
     settings.beginGroup(self.settingsSection)
     if settings.contains(u'use phonon'):
         log.info(u'Found old Phonon setting')
         players = self.media_controller.mediaPlayers.keys()
         has_phonon = u'phonon' in players
         if settings.value(u'use phonon')  and has_phonon:
             log.debug(u'Converting old setting to new setting')
             new_players = []
             if players:
                 new_players = [player for player in players if player != u'phonon']
             new_players.insert(0, u'phonon')
             self.media_controller.mediaPlayers[u'phonon'].isActive = True
             settings.setValue(u'players', u','.join(new_players))
             self.settingsTab.load()
         settings.remove(u'use phonon')
     settings.endGroup()
开发者ID:marmyshev,项目名称:transitions,代码行数:26,代码来源:mediaplugin.py


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