|
From: Kevin A. <ka...@us...> - 2004-04-27 23:08:31
|
Update of /cvsroot/pythoncard/PythonCard/samples/twistedEchoClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32747/twistedEchoClient Modified Files: twistedEchoClient.py Log Message: added loginDialog Index: twistedEchoClient.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/twistedEchoClient/twistedEchoClient.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** twistedEchoClient.py 27 Apr 2004 22:03:06 -0000 1.1 --- twistedEchoClient.py 27 Apr 2004 23:08:20 -0000 1.2 *************** *** 8,11 **** --- 8,13 ---- from twisted.internet import reactor + from PythonCard.templates.dialogs.loginDialog import loginDialog + class DefinedError(pb.Error): pass *************** *** 40,48 **** # other twisted apps def on_buttonLogin_mouseClick(self, event): ! reactor.connectTCP("localhost", pb.portno, self.pbfactory) ! self.pbfactory.login( ! UsernamePassword("guest", "guest") ! ).addCallbacks(self.loginsuccess, ! self.loginfailure) def loginsuccess(self, perspective): --- 42,57 ---- # other twisted apps def on_buttonLogin_mouseClick(self, event): ! result = loginDialog(self, port=pb.portno) ! if result['accepted']: ! # verify input here? ! host = result['host'] ! port = result['port'] ! username = result['username'] ! password = result['password'] ! reactor.connectTCP(host, port, self.pbfactory) ! self.pbfactory.login( ! UsernamePassword(username, password) ! ).addCallbacks(self.loginsuccess, ! self.loginfailure) def loginsuccess(self, perspective): |