annotate idavoll/tap.py @ 157:21fcfb86433f

Fix tests to work with current Twisted. Really do 0.5.0 release.
author Ralph Meijer <ralphm@ik.nu>
date Mon, 28 Aug 2006 12:48:45 +0000
parents 6250905b72f6
children 1701c0e2c707
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
155
5191ba7c4df8 Work towards first release 0.5.0.
Ralph Meijer <ralphm@ik.nu>
parents: 97
diff changeset
1 # Copyright (c) 2003-2006 Ralph Meijer
5191ba7c4df8 Work towards first release 0.5.0.
Ralph Meijer <ralphm@ik.nu>
parents: 97
diff changeset
2 # See LICENSE for details.
5191ba7c4df8 Work towards first release 0.5.0.
Ralph Meijer <ralphm@ik.nu>
parents: 97
diff changeset
3
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
4 from twisted.application import internet, service
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
5 from twisted.internet import interfaces
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
6 from twisted.python import usage
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
7 import idavoll
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
8
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
9 class Options(usage.Options):
156
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
10 optParameters = [
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
11 ('jid', None, 'pubsub'),
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
12 ('secret', None, 'secret'),
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
13 ('rhost', None, '127.0.0.1'),
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
14 ('rport', None, '5347'),
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
15 ('backend', None, 'memory'),
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
16 ('dbuser', None, ''),
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
17 ('dbname', None, 'pubsub'),
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
18 ]
76
66fac7cd9edc Added -v (--verbose) flag to print out all traffic.
Ralph Meijer <ralphm@ik.nu>
parents: 42
diff changeset
19
156
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
20 optFlags = [
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
21 ('verbose', 'v', 'Show traffic'),
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
22 ('hide-nodes', None, 'Hide all nodes for disco')
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
23 ]
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
24
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
25 def postOptions(self):
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
26 if self['backend'] not in ['pgsql', 'memory']:
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
27 raise usage.UsageError, "Unknown backend!"
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
28
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
29 def makeService(config):
156
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
30 return idavoll.makeService(config)