Remove "history" from Dragonfly. This was a feature that did nothing and we couldn't work out what it might have done if it was finished..
This commit is contained in:
@@ -286,8 +286,6 @@ pkgpythondragonfly_PYTHON := \
|
||||
src/www/bongo/dragonfly/Auth.py \
|
||||
src/www/bongo/dragonfly/CalendarView.py \
|
||||
src/www/bongo/dragonfly/Composer.py \
|
||||
src/www/bongo/dragonfly/HistoryHandler.py \
|
||||
src/www/bongo/dragonfly/HistoryServer.py \
|
||||
src/www/bongo/dragonfly/BongoCookie.py \
|
||||
src/www/bongo/dragonfly/HttpError.py \
|
||||
src/www/bongo/dragonfly/BongoFieldStorage.py \
|
||||
|
||||
@@ -20,7 +20,6 @@ import bongo.Xpl as Xpl
|
||||
import bongo.dragonfly
|
||||
from bongo.dragonfly.ResourcePath import ResourcePath
|
||||
from bongo.dragonfly.SmsHandler import SmsHandler
|
||||
from bongo.dragonfly.HistoryHandler import HistoryHandler
|
||||
from bongo.dragonfly.Standalone import HttpServer, HttpRequest
|
||||
from bongo.dragonfly.HttpError import HttpError
|
||||
import bongo.dragonfly.Auth
|
||||
@@ -172,24 +171,6 @@ class DragonflyHandler(SimpleHTTPRequestHandler):
|
||||
self.send_response(ret)
|
||||
return
|
||||
|
||||
if self.path.startswith("/history"):
|
||||
handler = HistoryHandler()
|
||||
mname = "do_" + self.command
|
||||
if not hasattr(handler, mname):
|
||||
self.send_error(501, "Unsupported method (%r)" % self.command)
|
||||
return
|
||||
method = getattr(handler, mname)
|
||||
self.dragonfly_req = True
|
||||
self.req = HttpRequest(self, "/history", self.server)
|
||||
ret = method(self.req)
|
||||
|
||||
if ret is None:
|
||||
self.send_response(bongo.dragonfly.HTTP_OK)
|
||||
else:
|
||||
self.send_response(ret)
|
||||
return
|
||||
|
||||
|
||||
if self.path.startswith("/admin"):
|
||||
self.dragonfly_req = True
|
||||
req = HttpRequest(self, "/admin", self.server)
|
||||
|
||||
@@ -22,17 +22,6 @@ Alias / @DATADIR@/@PACKAGE@/htdocs/
|
||||
PythonDebug On
|
||||
</Location>
|
||||
|
||||
<Location /history>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
|
||||
SetHandler python-program
|
||||
PythonPath "['@PYTHONDIR@']+sys.path"
|
||||
PythonHandler bongo.dragonfly.HistoryServer
|
||||
PythonOption DragonflyUriRoot "/history"
|
||||
PythonDebug On
|
||||
</Location>
|
||||
|
||||
<Location /admin>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import bongo.dragonfly
|
||||
|
||||
class HistoryHandler:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def do_GET(self, req):
|
||||
length = len(req.args)
|
||||
if length > 1024:
|
||||
raise HttpError(400, "Arguments too long")
|
||||
req.headers_out["Content-Length"] = str(length)
|
||||
req.headers_out["Cache-Control"] = "no-cache"
|
||||
req.content_type = "text/plain"
|
||||
req.write(req.args)
|
||||
return bongo.dragonfly.OK
|
||||
@@ -1,34 +0,0 @@
|
||||
from mod_python import apache, util
|
||||
from ApacheLogHandler import ApacheLogHandler, RequestLogProxy
|
||||
|
||||
from HttpError import HttpError
|
||||
|
||||
import bongo.dragonfly
|
||||
|
||||
from bongo.dragonfly.HistoryHandler import HistoryHandler
|
||||
|
||||
# Add a handler so messages from python's logging module go to apache.
|
||||
# We don't use that module in the Bongo server proper, because we need
|
||||
# to log to apache requests directly
|
||||
import logging
|
||||
logging.getLogger('').addHandler(ApacheLogHandler())
|
||||
logging.root.setLevel(logging.DEBUG)
|
||||
|
||||
def handler(req):
|
||||
req.log = RequestLogProxy(req)
|
||||
|
||||
try:
|
||||
handler = HistoryHandler()
|
||||
mname = "do_" + req.method
|
||||
|
||||
if not hasattr(handler, mname):
|
||||
return bongo.dragonfly.HTTP_NOT_IMPLEMENTED
|
||||
|
||||
method = getattr(handler, mname)
|
||||
ret = method(req)
|
||||
|
||||
if ret is None:
|
||||
self.send_response(bongo.dragonfly.HTTP_OK)
|
||||
return ret
|
||||
except HttpError, e:
|
||||
return e.code
|
||||
Reference in New Issue
Block a user