twisted/plugins/fixbot_logwatch_plugin.py
author Tero Marttila <terom@fixme.fi>
Sat, 20 Feb 2010 22:31:17 +0200
changeset 62 e4db89a5f6bc
parent 47 81b37185209c
permissions -rw-r--r--
restructure api, using AMP as the client-server protocol
from zope.interface import implements

from twisted.python import usage
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker

from twisted.application import internet

from fixbot import api, module
from fixbot import logwatch

class LogwatchOptions (api.ClientOptions) :
    optParameters = [
        ("logwatch-sources",    None,   None,   "See etc/fixbot-logwatch.py"),
    ]

    optFlags = [

    ]
    
class MyServiceMaker (object) :
    implements(IServiceMaker, IPlugin)
    tapname = "fixbot-logwatch"
    description = "FixBot (Logwatcher component)"
    options = LogwatchOptions

    def makeService (self, config) :
        return logwatch.makeService(config, api.amp.ClientProtocol)

serviceMaker = MyServiceMaker()