Mercurial > libervia-backend
diff src/plugins/plugin_xep_0277.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 | ee1125fffba8 |
children | 2daf7b4c6756 |
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0277.py Mon Mar 21 19:44:16 2016 +0100 +++ b/src/plugins/plugin_xep_0277.py Tue Mar 22 22:46:04 2016 +0100 @@ -28,7 +28,7 @@ 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 @@ # 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 @@ 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