本文整理汇总了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)