本文整理汇总了Python中backend.Backend.has_repositories方法的典型用法代码示例。如果您正苦于以下问题:Python Backend.has_repositories方法的具体用法?Python Backend.has_repositories怎么用?Python Backend.has_repositories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backend.Backend
的用法示例。
在下文中一共展示了Backend.has_repositories方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AbstractUI
# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import has_repositories [as 别名]
#.........这里部分代码省略.........
def get_displayed_handlers(self):
'''Return the list of displayed handler IDs.
This can either be a list of drivers which match your system, or which
match a search_driver() invocation.
'''
if self.current_search[0]:
return self.current_search[1]
else:
return self.backend().available(self.argv_options.mode)
def hwid_to_display_string(self, hwid):
'''Convert a type:value hardware ID string to a human friendly text.'''
try:
(type, value) = hwid.split(':', 1)
except ValueError:
return hwid
if type == 'printer_deviceid':
try:
import cupshelpers
except ImportError:
return hwid
info = cupshelpers.parseDeviceID(value)
return info['MFG'] + ' ' + info['MDL']
return hwid
def _check_repositories(self):
'''Check if we have package repositories, and if not, offer to update.'''
if self._dbus_iface.has_repositories():
return
if self.have_ui:
success = False
try:
self._repository_progress_shown = False
success = convert_dbus_exceptions(dbus_sync_call_signal_wrapper,
self._dbus_iface, 'update_repository_indexes',
{'repository_update_progress':
self._repository_progress_handler})
finally:
if self._repository_progress_shown:
self.ui_progress_finish()
# check success
if not success:
self.error_message('', self._(
'Downloading package indexes failed, please check your network status. '
'Most drivers will not be available.'))
else:
# This happens when running in --check mode. We do not particularly
# care about success here.
convert_dbus_exceptions(self._dbus_iface.update_repository_indexes)
#
# Session D-BUS server methods
#
DBUS_INTERFACE_NAME = 'com.ubuntu.DeviceDriver'
def dbus_server(self):