fixbot/example.py
author Tero Marttila <terom@fixme.fi>
Sat, 20 Feb 2010 22:31:17 +0200
changeset 62 e4db89a5f6bc
parent 58 31a17b0b5159
permissions -rw-r--r--
restructure api, using AMP as the client-server protocol
from twisted.internet import protocol, reactor
from twisted.python import log
import sys

import api

class ExampleModule (api.Module) :
    name = "example"
    version = 0x0001
    
    def handleConnect (self) :
        self.sendEvent("example", "this is an example event")
        self.disconnect()

if __name__ == '__main__' :
    log.startLogging(sys.stderr)
    
    module = ExampleModule()
    reactor.run()