def __init__(self, application, request, status_code, message=None, format_exc=[]): super(ErrorPage, self).__init__(application, request) self.set_status(status_code) self.status_message = message self.format_exc = format_exc self.is_debug = project.setting('application', 'debug', True) self._headers.update(utils.no_cache_headers())
def __init__(self, handler): self.__dict__['handler'] = handler self.handler._headers.update(utils.no_cache_headers()) if self.handler.get_secure_cookie("flash_message"): self.message = self.handler.get_secure_cookie("flash_message") self.handler.clear_cookie("flash_message") else: self.message = None settings = handler.application.settings self.__dict__['cookie_domain'] = settings.get('cookie_domain') self.__dict__['cookie_path'] = settings.get('cookie_path', '/') self.__dict__['cookie_expires_days'] = None
def _set_no_cache(handler, *args, **kwargs): handler._headers.update(utils.no_cache_headers()) return func(handler, *args, **kwargs)