twisted/plugins/fixbot_nexus_plugin.py
author Tero Marttila <terom@fixme.fi>
Wed, 17 Sep 2008 19:28:42 +0300
changeset 25 6c0a53a512d8
parent 23 67e71e9170e5
child 35 5b6043ce9686
permissions -rw-r--r--
make fifo.py less spammy, tweak other descriptions/init.d
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 nexus

class NexusOptions (usage.Options) :
    optParameters = [
#        (   "uid",          "u",    "fixbot",           "user to run as"                                ),
#        (   "gid",          "g",    "nogroup",          "group to run as"                               ),
        (   "irc-hostname", "s",    "irc.fixme.fi",     "IRC server hostname",                          ),
        (   "irc-port",     "p",    6667,               "IRC server port",                      int     ),
        (   "irc-nickname", "n",    "FixBotDev",        "IRC nickname",                                 ),
        (   "irc-username", "U",    "fixbot",           "IRC username",                                 ),
        (   "irc-channel",  "c",    "#fixme-test",      "IRC channel",                                  ),
        (   "api-listen",   "l",    "127.0.0.1",        "address for API server to listen on"           ),
        (   "api-port",     "P",    34888,              "port for API server to listen on",     int     ),
    ]

    optFlags = [

    ]

class MyServiceMaker (object) :
    implements(IServiceMaker, IPlugin)
    tapname = "fixbot_nexus"
    description = "FixBot (nexus component)"
    options = NexusOptions

    def makeService (self, config) :
        return nexus.makeService(config)

serviceMaker = MyServiceMaker()