nncli

NextCloud Notes Command Line Interface
git clone git://git.danielmoch.com/nncli.git
Log | Files | Refs | LICENSE

commit 817c7a0b0a912313c19cab3a7d42b9e1786e967e
parent 21bc8e1e7dcf39e77f19a77324e3a0c6b33b3204
Author: Eric Davis <edavis@insanum.com>
Date:   Thu, 10 Jul 2014 21:49:16 -0700

special gstyle search of just 'tag:trash' to show all trashed notes

Diffstat:
Mnotes_db.py | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/notes_db.py b/notes_db.py @@ -148,7 +148,10 @@ def _helper_gstyle_wordmatch(self, word_pats, content): def filter_notes_gstyle(self, search_string=None): filtered_notes = [] - active_notes = 0 # total number of notes, excluding deleted + + # total number of notes, excluding deleted + # if tag:trash then counts deleted as well + active_notes = 0 if not search_string: for k in self.notes: @@ -193,6 +196,15 @@ def filter_notes_gstyle(self, search_string=None): active_notes += 1 + if search_trash and len(groups) == 0: + # simple search of only 'tag:trash' to get all trashed notes + if n.get('deleted'): + filtered_notes.append( + utils.KeyValueObject(key=k, + note=n, + tagfound=1)) + continue + tagmatch = self._helper_gstyle_tagmatch(all_pats[0], n) word_pats = all_pats[1] + all_pats[2]