本文整理汇总了Python中leap.bitmask.config.providerconfig.ProviderConfig.get_name方法的典型用法代码示例。如果您正苦于以下问题:Python ProviderConfig.get_name方法的具体用法?Python ProviderConfig.get_name怎么用?Python ProviderConfig.get_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类leap.bitmask.config.providerconfig.ProviderConfig
的用法示例。
在下文中一共展示了ProviderConfig.get_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Wizard
# 需要导入模块: from leap.bitmask.config.providerconfig import ProviderConfig [as 别名]
# 或者: from leap.bitmask.config.providerconfig.ProviderConfig import get_name [as 别名]
#.........这里部分代码省略.........
Sets the status for the API certificate check. Also finishes
the provider bootstrapper thread since it's not needed anymore
from this point on, unless the whole check chain is restarted
"""
self._complete_task(data, self.ui.lblCheckApiCert,
True, self.SETUP_PROVIDER_PAGE)
def _service_selection_changed(self, service, state):
"""
SLOT
TRIGGER: service_checkbox.stateChanged
Adds the service to the state if the state is checked, removes
it otherwise
:param service: service to handle
:type service: str
:param state: state of the checkbox
:type state: int
"""
if state == QtCore.Qt.Checked:
self._selected_services = \
self._selected_services.union(set([service]))
else:
self._selected_services = \
self._selected_services.difference(set([service]))
def _populate_services(self):
"""
Loads the services that the provider provides into the UI for
the user to enable or disable.
"""
self.ui.grpServices.setTitle(
self.tr("Services by %s") %
(self._provider_config.get_name(),))
services = get_supported(
self._provider_config.get_services())
for service in services:
try:
if service not in self._shown_services:
checkbox = QtGui.QCheckBox(self)
service_label = get_service_display_name(
service, self.standalone)
checkbox.setText(service_label)
self.ui.serviceListLayout.addWidget(checkbox)
checkbox.stateChanged.connect(
partial(self._service_selection_changed, service))
checkbox.setChecked(True)
self._shown_services.add(service)
except ValueError:
logger.error(
self.tr("Something went wrong while trying to "
"load service %s" % (service,)))
def _current_id_changed(self, pageId):
"""
SLOT
TRIGGER: self.currentIdChanged
Prepares the pages when they appear
"""
if pageId == self.SELECT_PROVIDER_PAGE:
self._reset_provider_check()
self._enable_check("")