def handle(self): self.prompt = None self.promptstate = False self.isclosed = mutnodeset() self.dataq = queue.Queue() self.server.monitor.add_connection(self) while 1: try: data = self.rfile.readline().decode('utf-8') if not data: raise EOFError('End of file') if data.endswith(DONE): raise EOFError('DONE') except (EOFError, socket.error): break if data.endswith(READLINE): prompt = data[:-len(READLINE)] self.dataq.put(('PROMPT', prompt)) if self.prompt is None: self.firstdata = self.exec_cmd(cmd=None, retdata=1) else: self.dataq.put(('DATA', data)) self.close()
def handle(self): self.prompt = None self.promptstate = False self.isclosed = mutnodeset() self.dataq = Queue.Queue() self.server.monitor.add_connection(self) while 1: try: data = self.rfile.readline() if not data: raise EOFError,'End of file' if data.endswith(DONE): raise EOFError,'DONE' except (EOFError, socket.error): break if data.endswith(READLINE): prompt = data[:-len(READLINE)] self.dataq.put(('PROMPT',prompt)) if self.prompt is None: self.firstdata = self.exec_cmd(cmd=None,retdata=1) else: self.dataq.put(('DATA',data)) self.close()
def test_nodeset_relation(self): from guppy.sets import immnodeset, mutnodeset if 0: # This is hard to get to work accross different architectures # Noted Jan 17 2006 x = [0, 1, 'a', 'b'] x.sort(lambda a, b: cmp(id(a), id(b))) else: # This is a relaxed variant, still tests SOME thing! x = ['a'] for s in (immnodeset(x), mutnodeset(x)): for i in range(len(x)): self.chkrel(s, x[i], 'list(%%s)[%s]'%i)
def test_nodeset_relation(self): from guppy.sets import immnodeset, mutnodeset if 0: # This is hard to get to work accross different architectures # Noted Jan 17 2006 x = [0, 1, 'a', 'b'] x.sort(lambda a, b: cmp(id(a), id(b))) else: # This is a relaxed variant, still tests SOME thing! x = ['a'] for s in (immnodeset(x), mutnodeset(x)): for i in range(len(x)): self.chkrel(s, x[i], 'list(%%s)[%s]' % i)
def test_nodeset_relation(self): from guppy.sets import immnodeset, mutnodeset x = ['a'] for s in (immnodeset(x), mutnodeset(x)): for i in range(len(x)): self.chkrel(s, x[i], 'list(%%s)[%s]' % i)