fixbot/example.py
author Tero Marttila <terom@fixme.fi>
Thu, 04 Feb 2010 19:38:54 +0200
changeset 38 66a42168c80b
parent 21 aa6df8f9c44a
child 58 31a17b0b5159
permissions -rw-r--r--
allow config .py's to process their own locals
from twisted.internet import protocol, reactor
from twisted.python import log
import sys

import api

class ExampleModule (api.Module) :
    name = "example"
    version = 0x0001
    
    event_types = [
        "example"
    ]

    def handleConnect (self) :
        self.sendEvent("example", "this is an example event")
        self.disconnect()

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