core (tools): moved common to a separate package, and put data method in a data_format module
This commit is contained in:
parent
d0fb849398
commit
2d1d286be2
6 changed files with 15 additions and 15 deletions
|
|
@ -25,7 +25,7 @@ from twisted.internet import defer
|
|||
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 @@ class GroupBlog(object):
|
|||
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 @@ class GroupBlog(object):
|
|||
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 @@ class GroupBlog(object):
|
|||
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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue