comparison sat/plugins/plugin_misc_merge_requests.py @ 2807:0b7ce5daee9b

plugin XEP-0277: blog items data are now entirely serialised before going to bridge: So far, and for historical reasons, blog items data where serialised using a unicode: unicode dict, which was causing trouble for many types of values (timestamps, booleans, lists). This patch changes it by serialising the whole items before going to bridge, and deserialising it when going back. This way, complex data can be used easily in items. This impact psEvent and serItemsData* methods which are renamed transItemsData* because there are not always serialising anymore (a new argument "serialise" allows to specify it). When editing a blog post in jp, metadata are now more easy to manipulate, specially lists like tags.
author Goffi <goffi@goffi.org>
date Sat, 23 Feb 2019 18:59:00 +0100
parents f18d8315929e
children b2f323237fce
comparison
equal deleted inserted replaced
2806:2400cad2dace 2807:0b7ce5daee9b
140 client, service, node, max_items, extra, sub_id = self._s.prepareBridgeGet( 140 client, service, node, max_items, extra, sub_id = self._s.prepareBridgeGet(
141 service, node, max_items, sub_id, extra_dict, profile_key) 141 service, node, max_items, sub_id, extra_dict, profile_key)
142 d = self.get(client, service, node or None, max_items, item_ids, sub_id or None, 142 d = self.get(client, service, node or None, max_items, item_ids, sub_id or None,
143 extra.rsm_request, extra.extra) 143 extra.rsm_request, extra.extra)
144 d.addCallback(lambda (tickets, metadata, parsed_patches): ( 144 d.addCallback(lambda (tickets, metadata, parsed_patches): (
145 self._p.serItemsData((tickets, metadata)) + 145 self._p.transItemsData((tickets, metadata)) +
146 ([[{key: unicode(value) for key, value in p.iteritems()} 146 ([[{key: unicode(value) for key, value in p.iteritems()}
147 for p in patches] for patches in parsed_patches],))) 147 for p in patches] for patches in parsed_patches],)))
148 return d 148 return d
149 149
150 @defer.inlineCallbacks 150 @defer.inlineCallbacks