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


Python gobject.IO_OUT属性代码示例

本文整理汇总了Python中gobject.IO_OUT属性的典型用法代码示例。如果您正苦于以下问题:Python gobject.IO_OUT属性的具体用法?Python gobject.IO_OUT怎么用?Python gobject.IO_OUT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在gobject的用法示例。


在下文中一共展示了gobject.IO_OUT属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _install_transport_ready

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import IO_OUT [as 别名]
def _install_transport_ready(self):
        if ('r' in self.access_type):
            io_event = gobject.IO_IN
        else:
            io_event = gobject.IO_OUT

        self.tag = gobject.io_add_watch(self.fd, io_event,
                                        self._transport_ready_handler) 
开发者ID:liamw9534,项目名称:bt-manager,代码行数:10,代码来源:audio.py

示例2: _doReadOrWrite

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import IO_OUT [as 别名]
def _doReadOrWrite(self, source, condition, faildict={
        error.ConnectionDone: failure.Failure(error.ConnectionDone()),
        error.ConnectionLost: failure.Failure(error.ConnectionLost()),
        }):
        why = None
        inRead = False
        if condition & POLL_DISCONNECTED and not (condition & gobject.IO_IN):
            if source in self._reads:
                why = main.CONNECTION_DONE
                inRead = True
            else:
                why = main.CONNECTION_LOST
        else:
            try:
                if condition & gobject.IO_IN:
                    why = source.doRead()
                    inRead = True
                if not why and condition & gobject.IO_OUT:
                    # if doRead caused connectionLost, don't call doWrite
                    # if doRead is doWrite, don't call it again.
                    if not source.disconnected:
                        why = source.doWrite()
            except:
                why = sys.exc_info()[1]
                log.msg('Error In %s' % source)
                log.deferr()

        if why:
            self._disconnectSelectable(source, why, inRead) 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:31,代码来源:gtk2reactor.py

示例3: _doReadOrWrite

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import IO_OUT [as 别名]
def _doReadOrWrite(self, source, condition, faildict={
        error.ConnectionDone: failure.Failure(error.ConnectionDone()),
        error.ConnectionLost: failure.Failure(error.ConnectionLost()),
        }):
        why = None
        didRead = None
        if condition & POLL_DISCONNECTED and \
               not (condition & gobject.IO_IN):
            why = main.CONNECTION_LOST
        else:
            try:
                if condition & gobject.IO_IN:
                    why = source.doRead()
                    didRead = source.doRead
                if not why and condition & gobject.IO_OUT:
                    # if doRead caused connectionLost, don't call doWrite
                    # if doRead is doWrite, don't call it again.
                    if not source.disconnected and source.doWrite != didRead:
                        why = source.doWrite()
                        didRead = source.doWrite # if failed it was in write
            except:
                why = sys.exc_info()[1]
                log.msg('Error In %s' % source)
                log.deferr()

        if why:
            self._disconnectSelectable(source, why, didRead == source.doRead) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:29,代码来源:gtk2reactor.py


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