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


Python gobject.source_remove方法代码示例

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


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

示例1: data_ready

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import source_remove [as 别名]
def data_ready(self, sock, condition):
        address = self.addresses[sock]
        data = sock.recv(1024)

        if len(data) == 0:
            self.add_text("\nlost connection with %s" % address)
            gobject.source_remove(self.sources[address])
            del self.sources[address]
            del self.peers[address]
            del self.addresses[sock]
            sock.close()
        else:
            self.add_text("\n%s - %s" % (address, str(data)))
        return True

# --- other stuff 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:18,代码来源:bluezchat.py

示例2: doIteration

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import source_remove [as 别名]
def doIteration(self, delay):
        # flush some pending events, return if there was something to do
        # don't use the usual "while self.context.pending(): self.context.iteration()"
        # idiom because lots of IO (in particular test_tcp's
        # ProperlyCloseFilesTestCase) can keep us from ever exiting.
        log.msg(channel='system', event='iteration', reactor=self)
        if self.__pending():
            self.__iteration(0)
            return
        # nothing to do, must delay
        if delay == 0:
            return # shouldn't delay, so just return
        self.doIterationTimer = gobject.timeout_add(int(delay * 1000),
                                                self.doIterationTimeout)
        # This will either wake up from IO or from a timeout.
        self.__iteration(1) # block
        # note: with the .simulate timer below, delays > 0.1 will always be
        # woken up by the .simulate timer
        if self.doIterationTimer:
            # if woken by IO, need to cancel the timer
            gobject.source_remove(self.doIterationTimer)
            self.doIterationTimer = None 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:24,代码来源:gtk2reactor.py

示例3: unwatch

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import source_remove [as 别名]
def unwatch(self, _vte, terminal):
        """Unwatch a terminal"""
        vte = terminal.get_vte()
        vte.disconnect(self.watches[terminal])
        del(self.watches[terminal])
        gobject.source_remove(self.timers[terminal])
        del(self.timers[terminal]) 
开发者ID:OWASP,项目名称:NINJA-PingU,代码行数:9,代码来源:activitywatch.py

示例4: _start_update_timer

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import source_remove [as 别名]
def _start_update_timer(self):
        if self._update_timeout_id is not None:
            gobject.source_remove(self._update_timeout_id)
        #print "start_update_timer"
        self._update_timeout_id = gobject.timeout_add(int(SAMPLE_PERIOD/min(self.speed, 1)*1e3),
                                                      self.update_view_timeout,
                                                      priority=PRIORITY_UPDATE_VIEW) 
开发者ID:ntu-dsi-dcn,项目名称:ntu-dsi-dcn,代码行数:9,代码来源:core.py

示例5: _on_play_button_toggled

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import source_remove [as 别名]
def _on_play_button_toggled(self, button):
        if button.get_active():
            self._start_update_timer()
        else:
            if self._update_timeout_id is not None:
                gobject.source_remove(self._update_timeout_id) 
开发者ID:ntu-dsi-dcn,项目名称:ntu-dsi-dcn,代码行数:8,代码来源:core.py

示例6: _quit

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import source_remove [as 别名]
def _quit(self, *dummy_args):
        if self._update_timeout_id is not None:
            gobject.source_remove(self._update_timeout_id)
            self._update_timeout_id = None
        self.simulation.quit = True
        self.simulation.go.set()
        self.simulation.join()
        gtk.main_quit() 
开发者ID:ntu-dsi-dcn,项目名称:ntu-dsi-dcn,代码行数:10,代码来源:core.py

示例7: _timer_stop

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import source_remove [as 别名]
def _timer_stop(self):
        if self._timer is not None:
            gobject.source_remove(self._timer)
            self._timer = None 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:6,代码来源:backend_gtk.py

示例8: destroy

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import source_remove [as 别名]
def destroy(self):
        #gtk.DrawingArea.destroy(self)
        self.close_event()
        gobject.source_remove(self._idle_event_id)
        if self._idle_draw_id != 0:
            gobject.source_remove(self._idle_draw_id) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:8,代码来源:backend_gtk.py

示例9: stop

# 需要导入模块: import gobject [as 别名]
# 或者: from gobject import source_remove [as 别名]
def stop(self):
        self.dot_widget.animation = NoAnimation(self.dot_widget)
        if self.timeout_id is not None:
            gobject.source_remove(self.timeout_id)
            self.timeout_id = None 
开发者ID:krintoxi,项目名称:NoobSec-Toolkit,代码行数:7,代码来源:xdot.py


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