core (tools): moved common to a separate package, and put data method in a data_format module

This commit is contained in:
Goffi 2016-03-22 22:46:04 +01:00
commit 2d1d286be2

View file

@ -28,7 +28,7 @@ from twisted.python import failure
from sat.core import exceptions
from sat.tools import xml_tools
from sat.tools import sat_defer
from sat.tools import common
from sat.tools.common import data_format
# XXX: tmp.pubsub is actually use instead of wokkel version
from wokkel import pubsub
@ -326,7 +326,7 @@ class XEP_0277(object):
# categories
categories = (category_elt.getAttribute('term','') for category_elt in entry_elt.elements(NS_ATOM, 'category'))
common.iter2dict('tag', categories, microblog_data)
data_format.iter2dict('tag', categories, microblog_data)
## the trigger ##
# if other plugins have things to add or change
@ -426,7 +426,7 @@ class XEP_0277(object):
content=rfc3339.timestamp_from_tf(float(data.get('published', current_time))))
## categories ##
for tag in common.dict2iter("tag", data):
for tag in data_format.dict2iter("tag", data):
category_elt = entry_elt.addElement("category")
category_elt['term'] = tag