소스 검색

- fix for filter tags with encrypted tags in db

oz123 11 년 전
부모
커밋
c3557b3c77
2개의 변경된 파일21개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      pwman/data/drivers/sqlite.py
  2. 19 0
      pwman/ui/cli.py

+ 2 - 1
pwman/data/drivers/sqlite.py

@@ -226,7 +226,8 @@ class SQLiteDatabaseNewForm(Database):
                     first = False
                 sql += ("SELECT NODE FROM LOOKUP LEFT JOIN TAGS ON TAG = "
                         " TAGS.ID WHERE TAGS.DATA = ? ")
-                params.append(t.get_name())
+                #params.append(t.get_name())
+                params.append(t._name)
         try:
             self._cur.execute(sql, params)
             ids = []

+ 19 - 0
pwman/ui/cli.py

@@ -952,6 +952,25 @@ class PwmanCliNew(PwmanCli):
         except Exception, e:
             self.error(e)
 
+    def do_filter(self, args):
+        tagstrings = args.split()
+
+        try:
+            tags = []
+            for ts in tagstrings:
+                tags.append(Tag(ts))
+            self._db.filter(tags)
+
+            tags = self._db.currenttags()
+            print "Current tags: ",
+            if len(tags) == 0:
+                print "None",
+            for t in tags:
+                print "%s " % (t.get_name()),
+            print
+        except Exception, e:
+            self.error(e)
+
     def do_new(self, args):
         """
         can override default config settings the following way: