def on_data(self, data_bytes): text = decode_and_clean(data_bytes) if not self.port: m = re.match('^Observatory listening on http://.*?:(\d+)', text) self.port = int(m.groups()[0]) _logger.debug('captured observatory port: %d' % self.port) if self.listener: self.listener.on_data(text)
def on_error(self, data_bytes): if self.listener: self.listener.on_error(decode_and_clean(data_bytes))
def on_data(self, data_bytes): text = decode_and_clean(data_bytes) if self.listener: self.listener.on_data(text)