本文整理汇总了Python中twisted.internet.gtk2reactor.Gtk2Reactor.addReader方法的典型用法代码示例。如果您正苦于以下问题:Python Gtk2Reactor.addReader方法的具体用法?Python Gtk2Reactor.addReader怎么用?Python Gtk2Reactor.addReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.internet.gtk2reactor.Gtk2Reactor
的用法示例。
在下文中一共展示了Gtk2Reactor.addReader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addReader
# 需要导入模块: from twisted.internet.gtk2reactor import Gtk2Reactor [as 别名]
# 或者: from twisted.internet.gtk2reactor.Gtk2Reactor import addReader [as 别名]
def addReader(self, reader):
sup.addReader(self, reader)
## gtk docs suggest this - but it's stupid
## self.model.set(self.model.append(),
## 0, str(reader),
## 1, reader)
self._maybeAddServer(reader, read=1)
示例2: on_suspend_clicked
# 需要导入模块: from twisted.internet.gtk2reactor import Gtk2Reactor [as 别名]
# 或者: from twisted.internet.gtk2reactor.Gtk2Reactor import addReader [as 别名]
def on_suspend_clicked(self, w):
store, iter = self.servers.get_selection().get_selected()
data = store[iter]
sup.removeReader(self, data[1])
sup.removeWriter(self, data[1])
if data[COLUMN_DESCRIPTION].endswith('(suspended)'):
if data[COLUMN_READING]:
sup.addReader(self, data[COLUMN_TRANSPORT])
if data[COLUMN_WRITING]:
sup.addWriter(self, data[COLUMN_TRANSPORT])
data[COLUMN_DESCRIPTION] = str(data[COLUMN_TRANSPORT])
self.toggle_suspend(1)
else:
data[0] += ' (suspended)'
self.toggle_suspend(0)