Reformatted code base using black.

This commit is contained in:
Goffi 2024-06-19 18:44:57 +02:00
commit 53fdaa9d09

View file

@ -35,9 +35,7 @@ except ImportError:
NS_PUBSUB = "http://jabber.org/protocol/pubsub"
NS_GROUPBLOG = "http://salut-a-toi.org/protocol/groupblog"
# NS_PUBSUB_EXP = 'http://goffi.org/protocol/pubsub' #for non official features
NS_PUBSUB_EXP = (
NS_PUBSUB
) # XXX: we can't use custom namespace as Wokkel's PubSubService use official NS
NS_PUBSUB_EXP = NS_PUBSUB # XXX: we can't use custom namespace as Wokkel's PubSubService use official NS
NS_PUBSUB_GROUPBLOG = NS_PUBSUB_EXP + "#groupblog"
NS_PUBSUB_ITEM_CONFIG = NS_PUBSUB_EXP + "#item-config"
@ -107,7 +105,7 @@ class GroupBlog(object):
access_model = config_form.get(self._p.OPT_ACCESS_MODEL, self._p.ACCESS_OPEN)
if access_model == self._p.ACCESS_PUBLISHER_ROSTER:
opt = self._p.OPT_ROSTER_GROUPS_ALLOWED
microblog_data['groups'] = config_form.fields[opt].values
microblog_data["groups"] = config_form.fields[opt].values
def _data_2_entry_trigger(self, client, mb_data, entry_elt, item_elt):
"""Build fine access permission if needed
@ -115,7 +113,7 @@ class GroupBlog(object):
This trigger check if "group*" key are present,
and create a fine item config to restrict view to these groups
"""
groups = mb_data.get('groups', [])
groups = mb_data.get("groups", [])
if not groups:
return
if not client.server_groupblog_available:
@ -137,7 +135,8 @@ class GroupBlog(object):
"""
if "group" in mb_data:
options[self._p.OPT_ACCESS_MODEL] = self._p.ACCESS_PUBLISHER_ROSTER
options[self._p.OPT_ROSTER_GROUPS_ALLOWED] = mb_data['groups']
options[self._p.OPT_ROSTER_GROUPS_ALLOWED] = mb_data["groups"]
@implementer(iwokkel.IDisco)
class GroupBlog_handler(XMPPHandler):