.py Projects

interchat:

Ziel: IRC(www.wazee.org/chat.shtml - cgi-irc interface) mit Pro7(chat.pro-7.de) und Oe3 (chat.orf.at) zu verbinden und einen raum/channel für radiowazee zur verfügung stellen alle messages werden untereinander ausgetauscht z.b pro7 user sendet eine message -> sie wird von dem bot aufgefasst und an oe3 sowie an den IRC channel weitergeleitet.

Status: done

IRC: irc.oftc.net channel: #wazee
http://chat.orf.at raum: radiowazee
http://chat.pro-7.de raum: radiowazee

erste schritte .py

from twisted.internet.protocol import ClientFactory
from twisted.protocols.basic import LineReceiver
from twisted.internet import reactor
import sys

class ChatClient(LineReceiver):
        botname = "bot-man"
        def connectionMade(self):
                print "connection made\n"
        def lineReceived(self, line):
                print "received something\n"

def main():
        factory = ClientFactory()
        factory.protocol = ChatClient
        reactor.connectTCP('localhost',5000,factory)
        reactor.run()

if __name__ == '__main__':
        main()

2003/11/07 02:22 MET [-] Log opened.
2003/11/07 02:22 MET [-] twistd 1.1.0 (/usr/bin/python2.3 2.3.2) starting up
2003/11/07 02:22 MET [-] reactor class: twisted.internet.default.SelectReactor
2003/11/07 02:22 MET [-] Loading main.py...
2003/11/07 02:22 MET [-] Traceback (most recent call last):
2003/11/07 02:22 MET [-]   File "/usr/lib/python2.3/site-packages/twisted/application/app.py", line 89, in getApplication
2003/11/07 02:22 MET [-]     application = service.loadApplication(filename, style, passphrase)
2003/11/07 02:22 MET [-]   File "/usr/lib/python2.3/site-packages/twisted/application/service.py", line 291, in loadApplication
2003/11/07 02:22 MET [-]     application = sob.loadValueFromFile(filename, 'application', passphrase)
2003/11/07 02:22 MET [-]   File "/usr/lib/python2.3/site-packages/twisted/persisted/sob.py", line 212, in loadValueFromFile
2003/11/07 02:22 MET [-]     value = d[variable]
2003/11/07 02:22 MET [-] KeyError: 'application'
2003/11/07 02:22 MET [-] Failed to load application: 'application'
2003/11/07 02:22 MET [-] Traceback (most recent call last):
          File "/usr/bin/twistd", line 36, in ?
            run()
          File "/usr/lib/python2.3/site-packages/twisted/scripts/twistd.py", line 188, in run
            app.run(runApp, ServerOptions)
          File "/usr/lib/python2.3/site-packages/twisted/application/app.py", line 165, in run
            runApp(config)
          File "/usr/lib/python2.3/site-packages/twisted/scripts/twistd.py", line 178, in runApp
            application = app.getApplication(config, passphrase)
        --- <exception caught here> ---
          File "/usr/lib/python2.3/site-packages/twisted/application/app.py", line 89, in getApplication
            application = service.loadApplication(filename, style, passphrase)
          File "/usr/lib/python2.3/site-packages/twisted/application/service.py", line 291, in loadApplication
            application = sob.loadValueFromFile(filename, 'application', passphrase)
          File "/usr/lib/python2.3/site-packages/twisted/persisted/sob.py", line 212, in loadValueFromFile
            value = d[variable]
        exceptions.KeyError: 'application'
        

Failed to load application: 'application'
2003/11/07 02:22 MET [-] 

MarkusRechberger/python (zuletzt geändert am 2007-12-23 22:47:20 durch localhost)