Quarantine plugin refactoring. It is now working like the webmail plugin, ie with an anchor based ajax navigation. What is broken for the moment:

* search functionality,
 * headers do not appear while displaying a mail.

New message system. (see infobox.js)
This commit is contained in:
tonio
2010-04-02 19:07:37 +02:00
parent 6b542225d7
commit 0252cebb4e
20 changed files with 530 additions and 254 deletions
+11
View File
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import popen2
import os
import sys
import time
from django.conf import settings
from django.template import RequestContext
@@ -67,6 +68,16 @@ def _ctx_ok(url):
def _ctx_ko(tpl, ctx):
return {"status" : "ko", "content" : render_to_string(tpl, ctx)}
def getctx(status, level=1, callback=None, **kwargs):
if not callback:
callername = sys._getframe(level).f_code.co_name
else:
callername = callback
ctx = {"status" : status, "callback" : callername}
for kw, v in kwargs.iteritems():
ctx[kw] = v
return ctx
def decode(s, encodings=('utf8', 'latin1', 'windows-1252', 'ascii')):
for encoding in encodings:
try: