annotate twisted/plugins/pubsub.py @ 457:7c9792f934a2

psql: use `created` colum to sort by creation: `item_id` was used to sort by creation because it correspond to it and it's slighly more efficient, but #398 raises the use case of manually modified database to import items. The column has been changed to suit this use case, and `item_id` is now always added as last order, in case of date conflicts. This patch extends a contribution from Stephen Paul Weber (Singpolyma) from the ticket mentioned below. fix: 398
author Goffi <goffi@goffi.org>
date Thu, 30 Sep 2021 18:56:42 +0200
parents 1a179ad10125
children bc2e04a4d3c1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
414
ccb2a22ea0fc Python 3 port:
Goffi <goffi@goffi.org>
parents: 406
diff changeset
1 #!/usr/bin/env python3
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
2
440
074037832daf dates update
Goffi <goffi@goffi.org>
parents: 439
diff changeset
3 # Copyright (c) 2012-2021 Jérôme Poisson
312
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
4 # Copyright (c) 2003-2011 Ralph Meijer
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
5
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
6
312
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
7 # This program is free software: you can redistribute it and/or modify
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
10 # (at your option) any later version.
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
11
312
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
12 # This program is distributed in the hope that it will be useful,
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
15 # GNU Affero General Public License for more details.
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
16
312
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
19 # --
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
20
312
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
21 # This program is based on Idavoll (http://idavoll.ik.nu/),
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
22 # originaly written by Ralph Meijer (http://ralphm.net/blog/)
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
23 # It is sublicensed under AGPL v3 (or any later version) as allowed by the original
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
24 # license.
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
25
312
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
26 # --
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
27
312
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
28 # Here is a copy of the original license:
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
29
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
30 # Copyright (c) 2003-2011 Ralph Meijer
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
31
312
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
32 # Permission is hereby granted, free of charge, to any person obtaining
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
33 # a copy of this software and associated documentation files (the
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
34 # "Software"), to deal in the Software without restriction, including
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
35 # without limitation the rights to use, copy, modify, merge, publish,
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
36 # distribute, sublicense, and/or sell copies of the Software, and to
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
37 # permit persons to whom the Software is furnished to do so, subject to
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
38 # the following conditions:
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
39
312
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
40 # The above copyright notice and this permission notice shall be
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
41 # included in all copies or substantial portions of the Software.
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
42
312
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
43 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
44 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
45 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
46 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
47 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
48 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
5d7c3787672e fixed copyright put in docstring instead of comments
Goffi <goffi@goffi.org>
parents: 311
diff changeset
49 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
233
564ae55219e1 sublicensed under AGPL V3
Goffi <goffi@goffi.org>
parents: 192
diff changeset
50
155
5191ba7c4df8 Work towards first release 0.5.0.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
51
418
89736353f6be install sat_tmp's twisted patches for Python 3.8 compatibility
Goffi <goffi@goffi.org>
parents: 417
diff changeset
52 import sys
380
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
53 import csv
428
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
54 import os
418
89736353f6be install sat_tmp's twisted patches for Python 3.8 compatibility
Goffi <goffi@goffi.org>
parents: 417
diff changeset
55 from os.path import expanduser, realpath
89736353f6be install sat_tmp's twisted patches for Python 3.8 compatibility
Goffi <goffi@goffi.org>
parents: 417
diff changeset
56 import configparser
89736353f6be install sat_tmp's twisted patches for Python 3.8 compatibility
Goffi <goffi@goffi.org>
parents: 417
diff changeset
57 from zope.interface import implementer
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
58 from twisted.application.service import IServiceMaker
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
59 from twisted.application import service
380
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
60 from twisted.python import usage, log
418
89736353f6be install sat_tmp's twisted patches for Python 3.8 compatibility
Goffi <goffi@goffi.org>
parents: 417
diff changeset
61 from twisted.plugin import IPlugin
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
62 from twisted.words.protocols.jabber.jid import JID
418
89736353f6be install sat_tmp's twisted patches for Python 3.8 compatibility
Goffi <goffi@goffi.org>
parents: 417
diff changeset
63 import sat_pubsub
453
1a179ad10125 backend: service name can now be specified with `service_name` parameter
Goffi <goffi@goffi.org>
parents: 447
diff changeset
64 from sat_pubsub import const
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
65
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
66
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
67
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
68
380
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
69 def coerceListType(value):
414
ccb2a22ea0fc Python 3 port:
Goffi <goffi@goffi.org>
parents: 406
diff changeset
70 return next(csv.reader(
380
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
71 [value], delimiter=",", quotechar='"', skipinitialspace=True
414
ccb2a22ea0fc Python 3 port:
Goffi <goffi@goffi.org>
parents: 406
diff changeset
72 ))
380
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
73
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
74
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
75 def coerceJidListType(value):
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
76 values = [JID(v) for v in coerceListType(value)]
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
77 if any((j.resource for j in values)):
414
ccb2a22ea0fc Python 3 port:
Goffi <goffi@goffi.org>
parents: 406
diff changeset
78 raise ValueError("you must use bare jids")
380
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
79 return values
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
80
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
81
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
82
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
83 OPT_PARAMETERS_BOTH = [
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
84 ['jid', None, None, 'JID this component will be available at'],
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
85 ['xmpp_pwd', None, None, 'XMPP server component password'],
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
86 ['rhost', None, '127.0.0.1', 'XMPP server host'],
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
87 ['rport', None, '5347', 'XMPP server port'],
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
88 ['backend', None, 'pgsql', 'Choice of storage backend'],
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
89 ['db_user', None, None, 'Database user (pgsql backend)'],
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
90 ['db_name', None, 'pubsub', 'Database name (pgsql backend)'],
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
91 ['db_pass', None, None, 'Database password (pgsql backend)'],
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
92 ['db_host', None, None, 'Database host (pgsql backend)'],
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
93 ['db_port', None, None, 'Database port (pgsql backend)'],
453
1a179ad10125 backend: service name can now be specified with `service_name` parameter
Goffi <goffi@goffi.org>
parents: 447
diff changeset
94 ['service_name', None, const.SERVICE_NAME, 'Name of this Pubsub service'],
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
95 ]
428
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
96
380
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
97 OPT_PARAMETERS_CFG = [
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
98 ["admins_jids_list", None, [], "List of administrators' bare jids",
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
99 coerceJidListType]
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
100 ]
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
101
428
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
102 # prefix used for environment variables
447
cc29a62fb64c renaming following global Salut à Toi => Libervia renaming:
Goffi <goffi@goffi.org>
parents: 445
diff changeset
103 ENV_PREFIX = "LIBERVIA_PUBSUB_"
428
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
104 # mapping from option name to environment variables to use
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
105 # each parameter name links to a list of variable environment name
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
106 # if an environment variable of one of the names exists it will be used
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
107 # as default value, with priority over config file
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
108 ENV_OPT_MAP = {
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
109 # we use the same environment variables as PostgreSQL
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
110 'db_user': ['PGUSER'],
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
111 'db_name': ['PGDATABASE'],
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
112 'db_pass': ['PGPASSWORD'],
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
113 'db_host': ['PGHOST'],
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
114 'db_port': ['PGPORT'],
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
115 }
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
116 for opt in OPT_PARAMETERS_BOTH + OPT_PARAMETERS_CFG:
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
117 name = opt[0]
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
118 env_name = f"{ENV_PREFIX}{name.upper()}"
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
119 ENV_OPT_MAP.setdefault(name, []).append(env_name)
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
120
445
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
121 CONFIG_FILENAME = 'libervia'
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
122 # List of the configuration filenames sorted by ascending priority
445
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
123 CONFIG_FILES = (
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
124 [realpath(expanduser(path) + CONFIG_FILENAME + '.conf') for path in (
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
125 '/etc/', '/etc/{}/'.format(CONFIG_FILENAME),
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
126 '~/', '~/.',
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
127 '.config/', '.config/.',
426
6f8e1c180c83 added "~/.config/sat" as search patch for config
Goffi <goffi@goffi.org>
parents: 418
diff changeset
128 '.config/{}/'.format(CONFIG_FILENAME),
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
129 '', '.')]
445
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
130 +
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
131 # "sat.conf" is the legacy name of the config file
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
132 [realpath(expanduser(path) + "sat.conf") for path in (
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
133 '/etc/', '/etc/{}/'.format("sat"),
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
134 '~/', '~/.',
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
135 '.config/', '.config/.',
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
136 '.config/{}/'.format("sat"),
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
137 '', '.')]
fe24bb60236f core: update conf file name following project renaming:
Goffi <goffi@goffi.org>
parents: 440
diff changeset
138 )
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
139 CONFIG_SECTION = 'pubsub'
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
140
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
141
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
142 class Options(usage.Options):
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
143 optParameters = OPT_PARAMETERS_BOTH
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
144
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
145 optFlags = [
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
146 ('verbose', 'v', 'Show traffic'),
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
147 ('hide-nodes', None, 'Hide all nodes for disco')
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
148 ]
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
149
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
150 def __init__(self):
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
151 """Read SàT Pubsub configuration file in order to overwrite the hard-coded default values.
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
152
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
153 Priority for the usage of the values is (from lowest to highest):
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
154 - hard-coded default values
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
155 - values from SàT configuration files
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
156 - values passed on the command line
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
157 """
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
158 # If we do it the reading later: after the command line options have been parsed, there's no good way to know
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
159 # if the options values are the hard-coded ones or if they have been passed on the command line.
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
160
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
161 # FIXME: must be refactored + code can be factorised with backend
414
ccb2a22ea0fc Python 3 port:
Goffi <goffi@goffi.org>
parents: 406
diff changeset
162 config_parser = configparser.ConfigParser()
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
163 config_parser.read(CONFIG_FILES)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
164 for param in self.optParameters + OPT_PARAMETERS_CFG:
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
165 name = param[0]
428
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
166 for env_name in ENV_OPT_MAP[name]:
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
167 # we first check if value is set as an environment variable
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
168 value = os.getenv(env_name)
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
169 if value is not None:
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
170 self.setDefaultOption(param, value)
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
171 break
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
172 else:
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
173 # no environment variable set, let's try with configuration
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
174 try:
428
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
175 value = config_parser.get(CONFIG_SECTION, name)
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
176 self.setDefaultOption(param, value)
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
177 except (configparser.NoSectionError, configparser.NoOptionError):
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
178 pass
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
179 usage.Options.__init__(self)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
180 for opt_data in OPT_PARAMETERS_CFG:
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
181 self[opt_data[0]] = opt_data[2]
155
5191ba7c4df8 Work towards first release 0.5.0.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
182
428
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
183 def setDefaultOption(self, param, value):
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
184 """Set default option value using coerce method when needed
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
185
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
186 If the value is invalid, we quit the program with exit code 1
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
187 """
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
188 try:
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
189 param[2] = param[4](value)
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
190 except IndexError: # the coerce method is optional
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
191 param[2] = value
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
192 except Exception as e:
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
193 log.err('Invalid value for setting "{name}": {msg}'.format(
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
194 name=name, msg=e))
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
195 sys.exit(1)
34bd55179e22 environment variables can now be used to set options:
Goffi <goffi@goffi.org>
parents: 426
diff changeset
196
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
197 def postOptions(self):
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
198 if self['backend'] not in ['pgsql', 'memory']:
406
a58610ab2983 removed old code:
Goffi <goffi@goffi.org>
parents: 405
diff changeset
199 raise usage.UsageError("Unknown backend!")
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
200 if self['backend'] == 'memory':
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
201 raise NotImplementedError('memory backend is not available at the moment')
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
202
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
203 self['jid'] = JID(self['jid']) if self['jid'] else None
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
204
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
205
414
ccb2a22ea0fc Python 3 port:
Goffi <goffi@goffi.org>
parents: 406
diff changeset
206 @implementer(IServiceMaker, IPlugin)
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
207 class SatPubsubMaker(object):
447
cc29a62fb64c renaming following global Salut à Toi => Libervia renaming:
Goffi <goffi@goffi.org>
parents: 445
diff changeset
208 tapname = "libervia-pubsub"
cc29a62fb64c renaming following global Salut à Toi => Libervia renaming:
Goffi <goffi@goffi.org>
parents: 445
diff changeset
209 description = "Libervia's Publish-Subscribe Service Component"
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
210 options = Options
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
211
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
212 def makeService(self, config):
417
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
213 from wokkel.component import Component
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
214 from wokkel.disco import DiscoHandler
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
215 from wokkel.generic import FallbackHandler, VersionHandler
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
216 from wokkel.iwokkel import IPubSubResource
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
217 from wokkel import data_form
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
218 from wokkel import pubsub
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
219 from wokkel import rsm
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
220 from wokkel import mam
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
221 from sat_pubsub import mam as pubsub_mam
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
222 from sat_pubsub import pubsub_admin
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
223 from sat_pubsub.backend import BackendService, ExtraDiscoHandler
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
224 from sat_pubsub.privilege import PrivilegesHandler
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
225 from sat_pubsub.delegation import DelegationsHandler
412d26a9b2c2 import sat/wokkel modules only when making service:
Goffi <goffi@goffi.org>
parents: 414
diff changeset
226
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
227 if not config['jid'] or not config['xmpp_pwd']:
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
228 raise usage.UsageError("You must specify jid and xmpp_pwd")
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
229 s = service.MultiService()
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
230
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
231 # Create backend service with storage
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
232
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
233 if config['backend'] == 'pgsql':
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
234 from twisted.enterprise import adbapi
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
235 from sat_pubsub.pgsql_storage import Storage
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
236 from psycopg2.extras import NamedTupleConnection
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
237 keys_map = {
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
238 'db_user': 'user',
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
239 'db_pass': 'password',
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
240 'db_name': 'database',
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
241 'db_host': 'host',
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
242 'db_port': 'port',
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
243 }
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
244 kwargs = {}
414
ccb2a22ea0fc Python 3 port:
Goffi <goffi@goffi.org>
parents: 406
diff changeset
245 for config_k, k in keys_map.items():
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
246 v = config.get(config_k)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
247 if v is None:
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
248 continue
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
249 kwargs[k] = v
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
250 dbpool = adbapi.ConnectionPool('psycopg2',
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
251 cp_reconnect=True,
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
252 client_encoding='utf-8',
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
253 connection_factory=NamedTupleConnection,
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
254 **kwargs
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
255 )
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
256 st = Storage(dbpool)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
257 elif config['backend'] == 'memory':
406
a58610ab2983 removed old code:
Goffi <goffi@goffi.org>
parents: 405
diff changeset
258 raise NotImplementedError('memory backend is not available at the moment')
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
259
380
e81964db3cd6 administrators entities:
Goffi <goffi@goffi.org>
parents: 375
diff changeset
260 bs = BackendService(st, config)
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
261 bs.setName('backend')
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
262 bs.setServiceParent(s)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
263
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
264 # Set up XMPP server-side component with publish-subscribe capabilities
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
265
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
266 cs = Component(config["rhost"], int(config["rport"]),
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
267 config["jid"].full(), config["xmpp_pwd"])
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
268 cs.setName('component')
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
269 cs.setServiceParent(s)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
270
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
271 cs.factory.maxDelay = 900
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
272
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
273 if config["verbose"]:
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
274 cs.logTraffic = True
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
275
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
276 FallbackHandler().setHandlerParent(cs)
414
ccb2a22ea0fc Python 3 port:
Goffi <goffi@goffi.org>
parents: 406
diff changeset
277 VersionHandler('SàT Pubsub', sat_pubsub.__version__).setHandlerParent(cs)
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
278 DiscoHandler().setHandlerParent(cs)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
279
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
280 ph = PrivilegesHandler(config['jid'])
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
281 ph.setHandlerParent(cs)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
282 bs.privilege = ph
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
283
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
284 resource = IPubSubResource(bs)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
285 resource.hideNodes = config["hide-nodes"]
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
286 resource.serviceJID = config["jid"]
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
287
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
288 ps = (rsm if const.FLAG_ENABLE_RSM else pubsub).PubSubService(resource)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
289 ps.setHandlerParent(cs)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
290 resource.pubsubService = ps
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
291
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
292 if const.FLAG_ENABLE_MAM:
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
293 mam_resource = pubsub_mam.MAMResource(bs)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
294 mam_s = mam.MAMService(mam_resource)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
295 mam_s.addFilter(data_form.Field(var=const.MAM_FILTER_CATEGORY))
430
5a0ada3b61ca Full-Text Search implementation:
Goffi <goffi@goffi.org>
parents: 428
diff changeset
296 mam_s.addFilter(data_form.Field(var=const.MAM_FILTER_FTS))
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
297 mam_s.setHandlerParent(cs)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
298
382
77b52dbda89a pubsub_admin: Pubsub Admin experimental protocol first draft:
Goffi <goffi@goffi.org>
parents: 380
diff changeset
299 pa = pubsub_admin.PubsubAdminHandler(bs)
77b52dbda89a pubsub_admin: Pubsub Admin experimental protocol first draft:
Goffi <goffi@goffi.org>
parents: 380
diff changeset
300 pa.setHandlerParent(cs)
77b52dbda89a pubsub_admin: Pubsub Admin experimental protocol first draft:
Goffi <goffi@goffi.org>
parents: 380
diff changeset
301
375
9a787881b824 implemented Order-By ProtoXEP (MAM + PubSub)
Goffi <goffi@goffi.org>
parents: 369
diff changeset
302 # wokkel.pubsub doesn't handle non pubsub# disco
9a787881b824 implemented Order-By ProtoXEP (MAM + PubSub)
Goffi <goffi@goffi.org>
parents: 369
diff changeset
303 # and we need to announce other feature, so this is a workaround
9a787881b824 implemented Order-By ProtoXEP (MAM + PubSub)
Goffi <goffi@goffi.org>
parents: 369
diff changeset
304 # to add them
9a787881b824 implemented Order-By ProtoXEP (MAM + PubSub)
Goffi <goffi@goffi.org>
parents: 369
diff changeset
305 # FIXME: propose a patch upstream to fix this situation
9a787881b824 implemented Order-By ProtoXEP (MAM + PubSub)
Goffi <goffi@goffi.org>
parents: 369
diff changeset
306 ed = ExtraDiscoHandler()
9a787881b824 implemented Order-By ProtoXEP (MAM + PubSub)
Goffi <goffi@goffi.org>
parents: 369
diff changeset
307 ed.setHandlerParent(cs)
9a787881b824 implemented Order-By ProtoXEP (MAM + PubSub)
Goffi <goffi@goffi.org>
parents: 369
diff changeset
308
369
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
309 # XXX: delegation must be instancied at the end,
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
310 # because it does some MonkeyPatching on handlers
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
311 dh = DelegationsHandler()
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
312 dh.setHandlerParent(cs)
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
313 bs.delegation = dh
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
314
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
315 return s
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
316
dabee42494ac config file + cleaning:
Goffi <goffi@goffi.org>
parents: 368
diff changeset
317 serviceMaker = SatPubsubMaker()