diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2012-08-30 17:58:36 +0200 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2012-08-30 17:58:36 +0200 |
commit | ec7da1aac20a01838d30e02d550c13b22414be73 (patch) | |
tree | 8ad108ca47f38e40348941e4c76269f621292e36 /hyperkitty/api.py | |
parent | fe5985866065e2b77ef2c6b69e85b60153e89104 (diff) | |
download | hyperkitty-ec7da1aac20a01838d30e02d550c13b22414be73.tar.gz hyperkitty-ec7da1aac20a01838d30e02d550c13b22414be73.tar.xz hyperkitty-ec7da1aac20a01838d30e02d550c13b22414be73.zip |
Adapt to the new Storm-based KittyStore
Diffstat (limited to 'hyperkitty/api.py')
-rw-r--r-- | hyperkitty/api.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/hyperkitty/api.py b/hyperkitty/api.py index c39646e..1cea89c 100644 --- a/hyperkitty/api.py +++ b/hyperkitty/api.py @@ -8,9 +8,7 @@ import json import re from hyperkitty.utils import log - -import kittystore -STORE = kittystore.get_store(settings.KITTYSTORE_URL) +from hyperkitty.lib import ThreadSafeStorePool class EmailResource(View): @@ -20,6 +18,7 @@ class EmailResource(View): def get(self, request, mlist_fqdn, messageid): list_name = mlist_fqdn.split('@')[0] + STORE = ThreadSafeStorePool().get() email = STORE.get_message_by_hash_from_list(list_name, messageid) if not email: return HttpResponse(status=404) @@ -34,6 +33,7 @@ class ThreadResource(View): def get(self, request, mlist_fqdn, threadid): list_name = mlist_fqdn.split('@')[0] + STORE = ThreadSafeStorePool().get() thread = STORE.get_thread(list_name, threadid) if not thread: return HttpResponse(status=404) @@ -61,7 +61,8 @@ class SearchResource(View): query_string = {field.capitalize(): re.compile(regex, re.IGNORECASE)} - print query_string, field, keyword + #print query_string, field, keyword + STORE = ThreadSafeStorePool().get() threads = STORE.search_archives(list_name, query_string) if not threads: return HttpResponse(status=404) |