commit 66bddda07ae6294d4c8676d33b7d781bb96e6c6c
parent 7c14536f883ae7cb9baf3410f300a69cbe0e306e
Author: Daniel Moch <daniel@danielmoch.com>
Date: Mon, 30 Jul 2018 06:12:39 -0400
Favorite working
Diffstat:
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/nnotes_cli/nncli.py b/nnotes_cli/nncli.py
@@ -679,9 +679,7 @@ def gui_frame_keypress(self, size, key):
else: # self.gui_body_get().__class__ == view_note.ViewNote:
note = lb.note
- favorite = 1
- if 'favorite' in note: favorite = 0
- else: favorite = 1
+ favorite = not note['favorite']
self.ndb.set_note_favorite(note['localkey'], favorite)
diff --git a/nnotes_cli/notes_db.py b/nnotes_cli/notes_db.py
@@ -401,7 +401,7 @@ def set_note_favorite(self, key, favorite):
n['modified'] = int(time.time())
self.flag_what_changed(n, 'favorite')
self.log('Note {0} (key={1})'. \
- format('favorite' if favorited else \
+ format('favorite' if favorite else \
'unfavorited', key))
def helper_key_to_fname(self, k):
diff --git a/todo.txt b/todo.txt
@@ -1,3 +1,3 @@
-1. Pin->Favorite
-2. Sort
+1. Sort
+2. Search
3. Command line