Thank you, thank you, thank you!!!
On 2/28/06, Jean-Paul Calderone firstname.lastname@example.org wrote:
On Tue, 28 Feb 2006 10:59:50 -0800, Don Smith email@example.com wrote:
Yes, I'm sort of a Twisted newbie, so maybe this has an obvious answer,
I'm just not seeing it.
I have a Twisted program that I need to add in the ability to make a
telnet connection to a remote server and send some commands to it and
with the data received.
This all works great, except that the command sequence is hard coded in
TelnetClient class. I want to be able to reference the "cmd" parameter, which could be a list of commands to iterate over,etc. But I don't see
can access the "cmd" parameter that gets passed into the TelnetConnection class from within the TelnetClient class.
I'm really desparate for some help, I've been racking my brain on this
The usual approach is to save the data (`cmd' in this case) on the factory and use `self.factory.stuff' from the protocol. The `factory' attribute is set on the protocol class by the default `buildProtocol' implementation. It is not available in the protocol's `__init__', but is available by the time `connectionMade' is called.
Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python