[Twisted-Python] A Twisted Web Question....
lists at webcrunchers.com
Wed Dec 31 04:43:52 EST 2003
Below is a piece of code from ircLogBot.py in the examples section of
It makes reference to a "channel" - What is a channel.
I assume that "sys.argv" when passed into main()
must be a "channel"
Of course the person who wrote this module just had no inclination to
actually tell anyone how to use it. I know the 2nd argument is a file
name or path, but what is a "channel"....
I know I probably am really lame for asking these kinds of
questions, but i left my crystal ball on the planet venus, and
can't read the mind of the person who wrote this module.
"""A factory for LogBots.
A new protocol instance will be created each time we connect to the
# the class of the protocol to build
protocol = LogBot
def __init__(self, channel, filename):
self.channel = channel
self.filename = filename
def clientConnectionLost(self, connector, reason):
"""If we get disconnected, reconnect to server."""
def clientConnectionFailed(self, connector, reason):
print "connection failed:", reason
if __name__ == '__main__':
# create factory protocol and application
f = LogBotFactory(sys.argv, sys.argv)
# connect factory to this host and port
reactor.connectTCP("irc.freenode.net", 6667, f)
# run bot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 1576 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20031231/3509e2c5/attachment.bin
More information about the Twisted-Python