1 from zope.interface import implements
2 from twisted.python import usage
3 from twisted.plugin import IPlugin
4 from twisted.application.service import IServiceMaker
6 # Due to the directory layout, and the fact that plugin directories aren't
7 # modules (no __init__.py), this file is named something other than punjab.py,
8 # to ensure that this import pulls in the right module.
11 class Options(usage.Options):
13 ('host', None, 'localhost'),
15 ('httpb', 'b', "http-bind"),
16 ('polling', None, '15'),
17 ('html_dir', None, "./html"),
19 ('ssl_privkey', None, "ssl.key"),
20 ('ssl_cert', None, "ssl.crt"),
21 ('white_list', None, None,
22 'Comma separated list of domains to allow connections to. \
23 Begin an entry with a period to allow connections to subdomains. \
24 e.g.: --white_list=.example.com,domain.com'),
25 ('black_list', None, None,
26 'Comma separated list of domains to deny connections to. ' \
27 'Begin an entry with a period to deny connections to subdomains. '\
28 'e.g.: --black_list=.example.com,domain.com'),
32 ('verbose', 'v', 'Show traffic'),
35 class ServiceFactory(object):
36 implements(IServiceMaker, IPlugin)
38 description = "A HTTP XMPP client interface"
41 def makeService(self, options):
42 return punjab.makeService(options)
44 service = ServiceFactory()