Skip to content

Commit

Permalink
Quick Simperium fixes
Browse files Browse the repository at this point in the history
I am pushed for time. As with the simplenote.py changes for Simperium
I'm just trying to get something out that _works_ and then I can work on
making the code better.

It'd be easy if Python 2 just went away though.

- Use simplenote.py v2.0.0 (Simperium API)
- Make one test change; Haven't really looked into why it's now True
instead of 1. I.e. don't know if that's a Simperium change or something
I've not got quite right in the simplenote.py changes
- Handle the one Unicode / UTF-8 breakage I've found so far.
  • Loading branch information
atomicules committed Sep 30, 2018
1 parent eb14cbe commit bc6cbff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion autoload/SimplenoteUtilities.py
Expand Up @@ -705,7 +705,10 @@ def list_note_index_in_scratch_buffer(self, since=None, tags=[]):
def get_note_title(note):
""" get title of note """
note_lines = note["content"].split("\n")
return str(note_lines[0] if len(note_lines) > 0 else note["key"])
try:
return str(note_lines[0] if len(note_lines) > 0 else note["key"])
except UnicodeEncodeError:
return unicode(note_lines[0] if len(note_lines) > 0 else note["key"])


class NoteFetcher(Thread):
Expand Down
2 changes: 1 addition & 1 deletion autoload/simplenote.py
2 changes: 1 addition & 1 deletion tests/simplenote.vader
Expand Up @@ -69,7 +69,7 @@ Execute python:

Expect:
A third test note
1
True


# Deletes a note
Expand Down

0 comments on commit bc6cbff

Please sign in to comment.