[Twisted-Python] GUI application with Conch
Brendan Simon
Brendan at BrendanSimon.com
Mon Feb 6 03:05:09 EST 2006
Hi,
I want to write a gui application (wxPython) that runs on MSW and talks
to a Linux server that has an application that only runs on Posix based
systems. The current gui app runs on the Linux server and executes the
commands directly using popen, but I want to make it flexible enough so
that MSW users can run a local gui which will execute the commands on
the Linux server and display the results locally.
My question is one of architectural design. How is it best to structure
the program so that it can use a remote shell connect (eg. ssh, or
possibly other transports such as rsh, or rsh over a vpn, etc) as well
as using direct calls to the utilities when running directly on the
server ???
I've managed to get the sshsimpleclient.py going and talking to my linux
server with my login and rsa keys :)
I notice that this sample is different to the documentation mentioned here:
http://twistedmatrix.com/projects/conch/documentation/howto/conch_client.html
The sshsimpleclient.py does not have the following statements:
factory = protocol.ClientFactory()
factory.protocol = ClientTransport
reactor.connectTCP('localhost', 22, factory)
reactor.run()
Is one better than the other?
Is one method better going forward into the future?
Also, the sshsimpleclient.py seems to have the closed() method called
when issuing a command (eg. CatChannel, TrueChannel, etc). How can I
keep a channel open to run commands when I want ??
Cheers,
Brendan.
More information about the Twisted-Python
mailing list