diff --git a/src/plugins/plugin_blog_import.py b/src/plugins/plugin_blog_import.py index a47e36cf..dfef054a 100755 --- a/src/plugins/plugin_blog_import.py +++ b/src/plugins/plugin_blog_import.py @@ -121,24 +121,26 @@ class BlogImportPlugin(object): return mb_data + @defer.inlineCallbacks def importSubItems(self, client, item_import_data, mb_data, session, options): # comments data if len(item_import_data['comments']) != 1: raise NotImplementedError(u"can't manage multiple comment links") allow_comments = C.bool(mb_data.get('allow_comments', C.BOOL_FALSE)) if allow_comments: - comments_service, comments_node = self._m.getCommentsService(client), self._m.getCommentsNode(mb_data['id']) + comments_service = yield self._m.getCommentsService(client) + comments_node = self._m.getCommentsNode(mb_data['id']) mb_data['comments_service'] = comments_service.full() mb_data['comments_node'] = comments_node recurse_kwargs = { 'items_import_data':item_import_data['comments'][0], 'service':comments_service, 'node':comments_node} - return recurse_kwargs + defer.returnValue(recurse_kwargs) else: if item_import_data['comments'][0]: raise exceptions.DataError(u"allow_comments set to False, but comments are there") - return None + defer.returnValue(None) def publishItem(self, client, mb_data, service, node, session): log.debug(u"uploading item [{id}]: {title}".format(id=mb_data['id'], title=mb_data.get('title',''))) diff --git a/src/plugins/plugin_tickets_import.py b/src/plugins/plugin_tickets_import.py index c78ebff4..05d84b2c 100755 --- a/src/plugins/plugin_tickets_import.py +++ b/src/plugins/plugin_tickets_import.py @@ -123,7 +123,8 @@ class TicketsImportPlugin(object): # TODO: handle "private" metadata, to have non public access for node # TODO: node access/publish model should be customisable comments = ticket_data.get('comments', []) - service, node = self._m.getCommentsService(client), self._m.getCommentsNode(session['root_node'] + u'_' + ticket_data['id']) + service = yield self._m.getCommentsService(client) + node = self._m.getCommentsNode(session['root_node'] + u'_' + ticket_data['id']) node_options = {self._p.OPT_ACCESS_MODEL: self._p.ACCESS_OPEN, self._p.OPT_PERSIST_ITEMS: 1, self._p.OPT_MAX_ITEMS: -1, diff --git a/src/plugins/plugin_xep_0277.py b/src/plugins/plugin_xep_0277.py index 9799a9c8..fbfde631 100755 --- a/src/plugins/plugin_xep_0277.py +++ b/src/plugins/plugin_xep_0277.py @@ -541,7 +541,7 @@ class XEP_0277(object): try: comments_service = jid.JID(mb_data['comments_service']) except KeyError: - comments_service = self.getCommentsService(client, service) + comments_service = yield self.getCommentsService(client, service) try: yield self._p.createNode(client, comments_service, comments_node, options)