當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。