# Copyright (c) 2002 Samuel Brauer. All Rights Reserved. NO WARRANTY.
# $Revision: 1.4 $
import spb.makiEngine
import spb.mod_pythonHttpTransaction
import os
from mod_python import apache
def handler(req):
"""this is the main entry point into this module from mod_python"""
maki_trans = spb.mod_pythonHttpTransaction.mod_pythonHttpTransaction(req)
realpath = maki_trans.getRealPath()
realpath = spb.makiEngine.normalizeFilepath(realpath)
if(os.path.exists(realpath)):
spb.makiEngine.handleTransaction(maki_trans)
else:
#raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND
maki_trans.sendError(404, "Not found", maki_trans.getEnvironValue("PATH_INFO"))
return apache.OK
|