Mercurial > libervia-backend
diff src/plugins/plugin_misc_groupblog.py @ 1919:d3354c80bd1f
core (tools): moved common to a separate package, and put data method in a data_format module
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 22 Mar 2016 22:46:04 +0100 |
parents | d17772b0fe22 |
children | 2daf7b4c6756 |
line wrap: on
line diff
--- a/src/plugins/plugin_misc_groupblog.py Mon Mar 21 19:44:16 2016 +0100 +++ b/src/plugins/plugin_misc_groupblog.py Tue Mar 22 22:46:04 2016 +0100 @@ -25,7 +25,7 @@ from sat.core import exceptions from wokkel import disco, data_form, iwokkel from zope.interface import implements -from sat.tools import common +from sat.tools.common import data_format try: from twisted.words.protocols.xmlstream import XMPPHandler @@ -102,7 +102,7 @@ access_model = config_form.get(self._p.OPT_ACCESS_MODEL, self._p.ACCESS_OPEN) # FIXME: ACCESS_ROSTER need to be changed to a new ACCESS_PUBLISHER_ROSTER when available if access_model == self._p.ACCESS_ROSTER: - common.iter2dict('group', config_form.fields[self._p.OPT_ROSTER_GROUPS_ALLOWED].values, microblog_data) + data_format.iter2dict('group', config_form.fields[self._p.OPT_ROSTER_GROUPS_ALLOWED].values, microblog_data) def _data2entryTrigger(self, client, mb_data, entry_elt, item_elt): """Build fine access permission if needed @@ -110,7 +110,7 @@ This trigger check if "group*" key are present, and create a fine item config to restrict view to these groups """ - groups = list(common.dict2iter('group', mb_data)) + groups = list(data_format.dict2iter('group', mb_data)) if not groups: return if not client.server_groupblog_available: @@ -132,7 +132,7 @@ if "group" in mb_data: # FIXME: ACCESS_ROSTER need to be changed to a new ACCESS_PUBLISHER_ROSTER when available options[self._p.OPT_ACCESS_MODEL] = self._p.ACCESS_ROSTER - options[self._p.OPT_ROSTER_GROUPS_ALLOWED] = list(common.dict2iter('group', mb_data)) + options[self._p.OPT_ROSTER_GROUPS_ALLOWED] = list(data_format.dict2iter('group', mb_data)) class GroupBlog_handler(XMPPHandler):