当前位置: 首页>>代码示例>>Python>>正文


Python Backend.create_dbus_client方法代码示例

本文整理汇总了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
开发者ID:Fabioamd87,项目名称:nfs-manager,代码行数:51,代码来源:ui.py


注:本文中的backend.Backend.create_dbus_client方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。