nncli

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

commit 52f2c04ffecdb4b3780e1c50de3c229250877f5f
parent 83ff1ea0bdb7a23a2f6dbb52744e185bbf90a55a
Author: Eric Davis <edavis@insanum.com>
Date:   Thu, 10 Jul 2014 20:43:35 -0700

search using gstyle can now search trashed notes using tag:trash

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

diff --git a/notes_db.py b/notes_db.py @@ -174,6 +174,12 @@ def filter_notes_gstyle(self, search_string=None): groups = re.findall('tag:([^\s]+)|"([^"]+)"|([^\s]+)', search_string) all_pats = [[] for _ in range(3)] + search_trash = False + for g in groups: + if g[0] == 'trash': + groups.remove(g) + search_trash = True + # we end up with [[tag_pats],[multi_word_pats],[single_word_pats]] for g in groups: for i in range(3): @@ -182,7 +188,7 @@ def filter_notes_gstyle(self, search_string=None): for k in self.notes: n = self.notes[k] - if n.get('deleted'): + if not search_trash and n.get('deleted'): continue active_notes += 1