本文整理汇总了Python中backend.Backend.create_dbus_client方法的典型用法代码示例。如果您正苦于以下问题:Python Backend.create_dbus_client方法的具体用法?Python Backend.create_dbus_client怎么用?Python Backend.create_dbus_client使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backend.Backend
的用法示例。
在下文中一共展示了Backend.create_dbus_client方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: backend
# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import create_dbus_client [as 别名]
def backend(self):
'''Return D-BUS backend client interface.
This gets initialized lazily.
Set self.search_only to True to suppress a full system hardware
detection, especially if you use only search_driver() to
find a remote driver for a selected, already detected device.
'''
if self._dbus_iface is None:
try:
if self.argv_options.no_dbus:
self._dbus_iface = Backend()
else:
self._dbus_iface = Backend.create_dbus_client()
except Exception as e:
if hasattr(e, '_dbus_error_name') and e._dbus_error_name in (
'org.freedesktop.DBus.Error.FileNotFound',
'org.freedesktop.DBus.Error.NoServer'):
if self.have_ui:
self.error_message(self._('Cannot connect to D-BUS,'+\
' please use the --no-dbus option as root to'+\
' use jockey without it.'),
str(e))
else:
self.error_msg(str(e))
sys.exit(1)
else:
raise
self._check_repositories()
self._call_progress_dialog(
self._('Searching for available drivers...'),
self.search_only and self._dbus_iface.db_init or self._dbus_iface.detect,
timeout=600)
else:
# handle backend timeouts
try:
self._dbus_iface.handler_info(' ')
except Exception as e:
if hasattr(e, '_dbus_error_name') and e._dbus_error_name == \
'org.freedesktop.DBus.Error.ServiceUnknown':
self._dbus_iface = Backend.create_dbus_client()
self._check_repositories()
self._call_progress_dialog(
self._('Searching for available drivers...'),
self.search_only and self._dbus_iface.db_init or self._dbus_iface.detect,
timeout=600)
return self._dbus_iface