python - Twisted and command line history console application -


So I did the following (this app is a client and at the same time the server is):

 < Code> class WebCheckerCommandProtocol (recvline.HistoricRecvLine): def connection created (self): self.sendLine ("help 'for help.' Help '.) From def line (self, line): ... def connectionLost ( Self, reason): Stop the # reactor, just because it means running in the studio Reactor.stop () def do_listservers (self): "CMD for the query of all available servers Argument does not argue "conn = httplib.HTTPConnection (IP +": "+ port) conn.request (.....) response = conn Getresponse () print feedback.States, feedback.Aryison data = response. Def DOACS (self): conn = httplib.HTTPConnection (IP + ":" + port) conn.request (.....) def do_logUser (auto, name): conn = httplib.HTTPConnection (IP + ":" + Port ") conn.request (.....) class simple server (line receiver): def connection created (self): print 'connection': self.transport (self, reason): print self Transport. Clint, 'disconnected' DIF data received (self, line): "" "XML parser" "print line if __name__ ==" __main__ ": factory = factory () factory. Protocol = Simple server runpoint protocol (webcaker commodity protocol) reactor. The Litest TCP (1234, Factory) Reactor.Run ()  

When I run it I see the command line but nothing else works I can write command, but they work do not do.

What am I doing wrong?


Comments