twisted/plugins/iro_plugin.py
branchdevel
changeset 287 256a579a5bc6
child 294 0e75bd39767d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/twisted/plugins/iro_plugin.py	Fri Aug 10 13:21:26 2012 +0200
@@ -0,0 +1,26 @@
+from zope.interface import implements
+
+from twisted.python import usage
+from twisted.application.service import IServiceMaker
+from twisted.plugin import IPlugin
+
+from iro import iro
+
+class Options(usage.Options):
+    synopsis = "[options]"
+    longdesc = "Make an iro server."
+    optParameters = [
+        ['config', 'c', 'iro.conf', 'configuration file.'],
+    ]
+    
+class MyServiceMaker(object):
+    implements(IServiceMaker, IPlugin)
+    
+    tapname = "iro"
+    description = "An iro server."
+    options = Options
+    
+    def makeService(self, config):
+        return iro.makeService(config)
+
+serviceMaker = MyServiceMaker()