Skip to content

Commit

Permalink
fix viewing previous note versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Walladge committed Sep 15, 2018
1 parent 675f0df commit 60741ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions simplenote_cli/simplenote.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def get_api(self) -> Api:
self.api = self.authenticate(self.username, self.password)
return self.api

def get_note(self, noteid, version=None):
def get_note(self, noteid: str, version: int = None):
""" method to get a specific note
Arguments:
Expand All @@ -104,7 +104,9 @@ def get_note(self, noteid, version=None):
"""

try:
note = self.get_api().note.get(noteid)
note = self.get_api().note.get(noteid, version=version)
if version is not None:
note['version'] = version
if note is None:
return None, -1
note['key'] = noteid
Expand Down
2 changes: 1 addition & 1 deletion simplenote_cli/view_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def get_status_bar(self):
total = len(self.body.positions())

if self.old_note:
t = time.localtime(float(self.old_note['versiondate']))
t = time.localtime(float(self.old_note['modificationDate']))
title = utils.get_note_title(self.old_note)
version = self.old_note['version']
else:
Expand Down

0 comments on commit 60741ad

Please sign in to comment.