Simplenote Command Line Interface

When edit the file which content has “UTF-8” charset, something wrong: ... File "/usr/local/lib/python2.7/dist-packages/urwid/main_loop.py", line 499, in process_input k = self._topmost_widget.keypress(self.screen_size, k) File "/usr/local/lib/python2.7/dist-packages/simplenote_cli/sncli.py", line 615, in gui_frame_keypress content = self.exec_cmd_on_note(note) File "/usr/local/lib/python2.7/dist-packages/simplenote_cli/sncli.py", line 81, in exec_cmd_on_note tf = temp.tempfile_create(note if note else None, raw=raw) File "/usr/local/lib/python2.7/dist-packages/simplenote_cli/temp.py", line 21, in tempfile_create tf.write(note['content']) UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-5: ordinal not in range(128) I did a quick patch for myself. Without much more testing. Hope it will works well for other guys ;) simplenote_cli/sncli.py | 8 ++++---- simplenote_cli/temp.py | 4 ++-- 2 个文件被修改,插入 6 行(+),删除 6 行(-) diff --git simplenote_cli/sncli.py simplenote_cli/sncli.py index 0e76a91..bcac3db 100644 --- simplenote_cli/sncli.py +++ simplenote_cli/sncli.py @@ -623,8 +623,8 @@ class sncli: if not content: return None - md5_old...

2015-01-26 · wuan