diff frontends/src/jp/cmd_blog.py @ 2161:62dfa6e02f54

jp (base, blog, output(std)): fixed bad unicode handling in stdout, use of jp.disp instead of simple print
author Goffi <goffi@goffi.org>
date Tue, 21 Feb 2017 21:01:40 +0100
parents 970a348d3fe9
children 63d191c05ecd
line wrap: on
line diff
--- a/frontends/src/jp/cmd_blog.py	Tue Feb 21 21:01:40 2017 +0100
+++ b/frontends/src/jp/cmd_blog.py	Tue Feb 21 21:01:40 2017 +0100
@@ -277,7 +277,7 @@
                     k_fmt_e = A.RESET,
                     sep = u'\n' if 'content' in k else u'')
                 value = k_cb[k](item, keys) if k in k_cb else item[k]
-                print header + value
+                self.disp(header + value)
             # we want a separation line after each item but the last one
             if idx < len(items)-1:
                 print(u'')
@@ -332,7 +332,7 @@
             if (title or tags) and content:
                 print("")
             if content:
-                print content
+                self.disp(content)
 
             print(u'\n' + sep  + '\n')
 
@@ -812,16 +812,16 @@
                 if getattr(self.args, name):
                     self.parser.error(_(u"{name} argument can't be used without location argument").format(name=name))
             if self.args.importer is None:
-                print u'\n'.join([u'{}: {}'.format(name, desc) for name, desc in self.host.bridge.blogImportList()])
+                self.disp(u'\n'.join([u'{}: {}'.format(name, desc) for name, desc in self.host.bridge.blogImportList()]))
             else:
                 try:
                     short_desc, long_desc = self.host.bridge.blogImportDesc(self.args.importer)
                 except Exception as e:
                     msg = [l for l in unicode(e).split('\n') if l][-1] # we only keep the last line
-                    print msg
+                    self.disp(msg)
                     self.host.quit(1)
                 else:
-                    print u"{name}: {short_desc}\n\n{long_desc}".format(name=self.args.importer, short_desc=short_desc, long_desc=long_desc)
+                    self.disp(u"{name}: {short_desc}\n\n{long_desc}".format(name=self.args.importer, short_desc=short_desc, long_desc=long_desc))
             self.host.quit()
         else:
             # we have a location, an import is requested