''' Created on Jan 31, 2010 @author: epeli ''' import os.path from mod_python import psp import config def PSPSapluuna(req, filename=None, string=None, vars={}): if filename: filename = os.path.join(config.template_dir, filename) # Without this mod_python will only show not found page of apache if not os.path.exists(filename): msg = "PSP template does not exist %s" % filename raise IOError(msg) return psp.PSP(req, filename, string=None, vars={}) #class PSPSapluuna(psp.PSP): # template_dir = "." # """ # Small wrapper for Python server pages to work in # this environment. # # We multi inherit this to get New style classes. # http://docs.python.org/reference/datamodel.html#new-style-and-classic-classes # """ # def __init__(self, req, filename=None, string=None, vars={}): # # # filepath = os.path.join(self.template_dir, filename) # # # Without this mod_python will only show not found page of apache # if not os.path.exists(filepath): # msg = "PSP template does not exist %s" % filepath # raise IOError(msg) # # psp.PSP.__init__(self, req, filepath, string, vars) # object.__init__(self)