예제 #1
0
class PantsStream(object):
    def __init__(self, socket):
        self._stream = Stream(socket=socket)
        self._stream._handle_connect_event()

    def write(self, data):
        self._stream.write(data)

    def read(self, size, callback):
        self._stream.on_read = callback
        self._stream.read_delimiter = size

    def set_close_callback(self, callback):
        self._stream.on_close = callback

    def close(self):
        del self._stream.on_read
        del self._stream.on_close
        self._stream.close()
예제 #2
0
파일: telnet.py 프로젝트: apt-shansen/pants
    def __init__(self, **kwargs):
        Stream.__init__(self, **kwargs)

        # Initialize Stuff
        self._telnet_data = ""
예제 #3
0
파일: telnet.py 프로젝트: vasudevram/pants
    def __init__(self, **kwargs):
        Stream.__init__(self, **kwargs)

        # Initialize Stuff
        self._telnet_data = ""
예제 #4
0
 def __init__(self, socket):
     self._stream = Stream(socket=socket)
     self._stream._handle_connect_event()