diff src/plugins/plugin_blog_import.py @ 1839:cdecf553e051

frontends (jp/blog), plugin blog_import: fixes: - argparse argument with nargs > 1 and default == {} crashes when reading the user input - separate blog import options with a new line - convert DBus strings received by the backend to unicode
author souliane <souliane@mailoo.org>
date Thu, 04 Feb 2016 11:44:43 +0100
parents 68c0dc13d821
children 489b968b3723
line wrap: on
line diff
--- a/src/plugins/plugin_blog_import.py	Thu Jan 28 16:44:47 2016 +0100
+++ b/src/plugins/plugin_blog_import.py	Thu Feb 04 11:44:43 2016 +0100
@@ -94,12 +94,13 @@
 
     def _blogImport(self, name, location, options, pubsub_service='', profile=C.PROF_KEY_DEFAULT):
         client = self.host.getClient(profile)
+        options = {key: unicode(value) for key, value in options.iteritems()}
         for option in BOOL_OPTIONS:
             try:
                 options[option] = C.bool(options[option])
             except KeyError:
                 pass
-        return self.blogImport(client, name, location, options)
+        return self.blogImport(client, unicode(name), unicode(location), options)
 
     @defer.inlineCallbacks
     def blogImport(self, client, name, location, options=None, pubsub_service=None):