From ec7da1aac20a01838d30e02d550c13b22414be73 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Thu, 30 Aug 2012 17:58:36 +0200 Subject: Adapt to the new Storm-based KittyStore --- hyperkitty/api.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'hyperkitty/api.py') 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) -- cgit