# Copyright (c) 2002 Samuel Brauer. All Rights Reserved. NO WARRANTY.
# $Revision: 1.2 $
import spb.makiEngine
import spb.webwareHttpTransaction
import os
import WebKit.HTTPServlet
class Servlet(WebKit.HTTPServlet.HTTPServlet):
def respondToPost(self, trans):
self.handle(trans)
def respondToGet(self, trans):
self.handle(trans)
def handle(self, trans):
maki_trans = spb.webwareHttpTransaction.webwareHttpTransaction(trans)
realpath = maki_trans.getRealPath()
realpath = spb.makiEngine.normalizeFilepath(realpath)
if(os.path.exists(realpath)):
spb.makiEngine.handleTransaction(maki_trans)
else:
maki_trans.sendError(404, "Not found", maki_trans.getEnvironValue("PATH_INFO"))
|