本文整理匯總了Python中leap.bitmask.config.leapsettings.LeapSettings.is_pinned_provider方法的典型用法代碼示例。如果您正苦於以下問題:Python LeapSettings.is_pinned_provider方法的具體用法?Python LeapSettings.is_pinned_provider怎麽用?Python LeapSettings.is_pinned_provider使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類leap.bitmask.config.leapsettings.LeapSettings
的用法示例。
在下文中一共展示了LeapSettings.is_pinned_provider方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _load_configured_providers
# 需要導入模塊: from leap.bitmask.config.leapsettings import LeapSettings [as 別名]
# 或者: from leap.bitmask.config.leapsettings.LeapSettings import is_pinned_provider [as 別名]
def _load_configured_providers(self):
"""
Loads the configured providers into the wizard providers combo box.
"""
ls = LeapSettings()
providers = ls.get_configured_providers()
if not providers:
self.ui.rbExistingProvider.setEnabled(False)
self.ui.label_8.setEnabled(False) # 'https://' label
self.ui.cbProviders.setEnabled(False)
return
pinned = []
user_added = []
# separate pinned providers from user added ones
for p in providers:
if ls.is_pinned_provider(p):
pinned.append(p)
else:
user_added.append(p)
if user_added:
self.ui.cbProviders.addItems(user_added)
if user_added and pinned:
self.ui.cbProviders.addItem('---')
if pinned:
random.shuffle(pinned) # don't prioritize alphabetically
self.ui.cbProviders.addItems(pinned)
# We have configured providers, so by default we select the
# 'Use existing provider' option.
self.ui.rbExistingProvider.setChecked(True)