annotate idavoll/tap.py @ 163:1701c0e2c707

Add --dbpass option for passing a password to the PostgreSQL backend. Author: edwinm Reviewer: ralphm Fixes #1
author Ralph Meijer <ralphm@ik.nu>
date Thu, 07 Sep 2006 11:13:46 +0000
parents 6250905b72f6
children ef22e4150caa
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'),
163
1701c0e2c707 Add --dbpass option for passing a password to the PostgreSQL backend.
Ralph Meijer <ralphm@ik.nu>
parents: 156
diff changeset
18 ('dbpass', None, ''),
156
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
19 ]
76
66fac7cd9edc Added -v (--verbose) flag to print out all traffic.
Ralph Meijer <ralphm@ik.nu>
parents: 42
diff changeset
20
156
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
21 optFlags = [
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
22 ('verbose', 'v', 'Show traffic'),
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
23 ('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
24 ]
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
25
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
26 def postOptions(self):
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
27 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
28 raise usage.UsageError, "Unknown backend!"
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
29
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
30 def makeService(config):
156
6250905b72f6 Fix spacing errors. Do 0.5.0 release.
Ralph Meijer <ralphm@ik.nu>
parents: 155
diff changeset
31 return idavoll.makeService(config)