annotate idavoll/tap.py @ 128:b27a66637a10

Add more documentation.
author Ralph Meijer <ralphm@ik.nu>
date Sun, 24 Apr 2005 17:23:12 +0000
parents cf918d581da5
children 5191ba7c4df8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
1 from twisted.application import internet, service
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
2 from twisted.internet import interfaces
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
3 from twisted.python import usage
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
4 import idavoll
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
5
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
6 class Options(usage.Options):
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
7 optParameters = [
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
8 ('jid', None, 'pubsub'),
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
9 ('secret', None, None),
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
10 ('rhost', None, '127.0.0.1'),
42
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
11 ('rport', None, '6000'),
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
12 ('backend', None, 'memory'),
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
13 ('dbuser', None, ''),
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
14 ('dbname', None, 'pubsub'),
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
15 ]
76
66fac7cd9edc Added -v (--verbose) flag to print out all traffic.
Ralph Meijer <ralphm@ik.nu>
parents: 42
diff changeset
16
97
cf918d581da5 Enable admin to hide all nodes when the service is queried using disco items.
Ralph Meijer <ralphm@ik.nu>
parents: 76
diff changeset
17 optFlags = [
cf918d581da5 Enable admin to hide all nodes when the service is queried using disco items.
Ralph Meijer <ralphm@ik.nu>
parents: 76
diff changeset
18 ('verbose', 'v', 'Show traffic'),
cf918d581da5 Enable admin to hide all nodes when the service is queried using disco items.
Ralph Meijer <ralphm@ik.nu>
parents: 76
diff changeset
19 ('hide-nodes', None, 'Hide all nodes for disco')
cf918d581da5 Enable admin to hide all nodes when the service is queried using disco items.
Ralph Meijer <ralphm@ik.nu>
parents: 76
diff changeset
20 ]
42
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
21
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
22 def postOptions(self):
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
23 if self['backend'] not in ['pgsql', 'memory']:
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
24 raise usage.UsageError, "Unknown backend!"
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
25
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
26 def makeService(config):
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
27 return idavoll.makeService(config)