1
# -*- coding: utf-8 -*-
3
# Copyright (c) 2002 - 2007 Detlev Offenbach <detlev@die-offenbachs.de>
4
# Copyright (c) 2000 Phil Thompson <phil@river-bank.demon.co.uk>
8
Module implementing a Qt free base class of an asynchronous interface for the debugger.
14
Class implementing asynchronous reading and writing.
20
@param parent the optional parent of this object (QObject) (ignored)
22
# There is no connection yet.
27
Public method to disconnect any current connection.
32
def setDescriptors(self,rfd,wfd):
34
Public method called to set the descriptors for the connection.
36
@param rfd file descriptor of the input file (int)
37
@param wfd file descriptor of the output file (int)
45
def readReady(self,fd):
47
Protected method called when there is data ready to be read.
49
@param fd file descriptor of the file that has data to be read (int)
52
got = self.readfd.readline_p()
60
self.rbuf = self.rbuf + got
62
# Call handleLine for the line if it is complete.
63
eol = self.rbuf.find('\n')
66
s = self.rbuf[:eol + 1]
67
self.rbuf = self.rbuf[eol + 1:]
69
eol = self.rbuf.find('\n')
71
def writeReady(self,fd):
73
Protected method called when we are ready to write data.
75
@param fd file descriptor of the file that has data to be written (int)
77
self.writefd.write(self.wbuf)
83
Public method to write a string.
85
@param s the data to be written (string)
87
self.wbuf = self.wbuf + s