summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2018-06-23 12:47:40 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2018-07-24 22:05:56 +0100
commitb8916a64cb5cc48928da50efc19d238402e5ba8e (patch)
tree07a355f94006c642d848e491a80b1c0af187ac53 /alot
parent31b61bc5868dfab22121a8f7c4a20f3b0778db10 (diff)
add getter for named queries to DB manager
Diffstat (limited to 'alot')
-rw-r--r--alot/db/manager.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/alot/db/manager.py b/alot/db/manager.py
index 53170f87..14925816 100644
--- a/alot/db/manager.py
+++ b/alot/db/manager.py
@@ -298,6 +298,14 @@ class DBManager(object):
db = Database(path=self.path)
return [t for t in db.get_all_tags()]
+ def get_named_queries(self):
+ """
+ returns the named queries stored in the database.
+ :rtype: dict (str -> str) mapping alias to full query string
+ """
+ db = Database(path=self.path)
+ return {k[6:]: v for k, v in db.get_configs('query.')}
+
def async(self, cbl, fun):
"""
return a pair (pipe, process) so that the process writes