def sleep(self, transaction): BaseServlet.sleep(self, transaction) self.session = None self.request = None self._request = None self.response = None self.transaction = None
def awake(self, transaction): BaseServlet.awake(self, transaction) # a hack to signify that the servlet is being run directly from WebKit self.isControlledByWebKit = True self.transaction = transaction self.application = transaction.application self.response = response = transaction.response self.request = transaction.request # Temporary hack to accomodate bug in # WebKit.Servlet.Servlet.serverSidePath: it uses # self._request even though this attribute does not exist. # This attribute WILL disappear in the future. self._request = transaction.request() self.session = transaction.session self.write = response().write
def serverSidePath(self, path=None, normpath=os.path.normpath, abspath=os.path.abspath ): if self.isControlledByWebKit: return BaseServlet.serverSidePath(self, path) elif path: return normpath(abspath(path.replace("\\",'/'))) elif hasattr(self, '_filePath') and self._filePath: return normpath(abspath(self._filePath)) else: return None
def serverSidePath(self, path=None, normpath=os.path.normpath, abspath=os.path.abspath): if self.isControlledByWebKit: return BaseServlet.serverSidePath(self, path) elif path: return normpath(abspath(path.replace("\\", '/'))) elif hasattr(self, '_filePath') and self._filePath: return normpath(abspath(self._filePath)) else: return None
def __init__(self): BaseServlet.__init__(self) # this default will be changed by the .awake() method self.isControlledByWebKit = False