Skip to content

Commit 60741ad

Browse files
author
Samuel Walladge
committed
fix viewing previous note versions
1 parent 675f0df commit 60741ad

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

simplenote_cli/simplenote.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def get_api(self) -> Api:
8888
self.api = self.authenticate(self.username, self.password)
8989
return self.api
9090

91-
def get_note(self, noteid, version=None):
91+
def get_note(self, noteid: str, version: int = None):
9292
""" method to get a specific note
9393
9494
Arguments:
@@ -104,7 +104,9 @@ def get_note(self, noteid, version=None):
104104
"""
105105

106106
try:
107-
note = self.get_api().note.get(noteid)
107+
note = self.get_api().note.get(noteid, version=version)
108+
if version is not None:
109+
note['version'] = version
108110
if note is None:
109111
return None, -1
110112
note['key'] = noteid

simplenote_cli/view_note.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def get_status_bar(self):
132132
total = len(self.body.positions())
133133

134134
if self.old_note:
135-
t = time.localtime(float(self.old_note['versiondate']))
135+
t = time.localtime(float(self.old_note['modificationDate']))
136136
title = utils.get_note_title(self.old_note)
137137
version = self.old_note['version']
138138
else:

0 commit comments

Comments
 (0)