Mercurial > libervia-pubsub
annotate idavoll/tap.py @ 155:5191ba7c4df8
Work towards first release 0.5.0.
- Add licensing information (MIT)
- Improve installation instructions.
- Use new plugins framework in twisted.
author | Ralph Meijer <ralphm@ik.nu> |
---|---|
date | Mon, 21 Aug 2006 16:05:35 +0000 |
parents | cf918d581da5 |
children | 6250905b72f6 |
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 | 4 from twisted.application import internet, service |
5 from twisted.internet import interfaces | |
6 from twisted.python import usage | |
7 import idavoll | |
8 | |
9 class Options(usage.Options): | |
10 optParameters = [ | |
11 ('jid', None, 'pubsub'), | |
155
5191ba7c4df8
Work towards first release 0.5.0.
Ralph Meijer <ralphm@ik.nu>
parents:
97
diff
changeset
|
12 ('secret', None, 'secret'), |
1 | 13 ('rhost', None, '127.0.0.1'), |
155
5191ba7c4df8
Work towards first release 0.5.0.
Ralph Meijer <ralphm@ik.nu>
parents:
97
diff
changeset
|
14 ('rport', None, '5347'), |
42
7d088c61e131
Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents:
1
diff
changeset
|
15 ('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
|
16 ('dbuser', None, ''), |
7d088c61e131
Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents:
1
diff
changeset
|
17 ('dbname', None, 'pubsub'), |
1 | 18 ] |
76
66fac7cd9edc
Added -v (--verbose) flag to print out all traffic.
Ralph Meijer <ralphm@ik.nu>
parents:
42
diff
changeset
|
19 |
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
|
20 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
|
21 ('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
|
22 ('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
|
23 ] |
42
7d088c61e131
Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents:
1
diff
changeset
|
24 |
7d088c61e131
Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents:
1
diff
changeset
|
25 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
|
26 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
|
27 raise usage.UsageError, "Unknown backend!" |
1 | 28 |
29 def makeService(config): | |
30 return idavoll.makeService(config) |