try: if response._custom_rollback: response._custom_rollback() else: SQLDB.close_all_instances(SQLDB.rollback) except: pass e = RestrictedError('Framework', '', '', locals()) ticket = e.log(request) or 'unrecoverable' http_response = \ HTTP(500, rewrite.params.error_message_ticket % dict(ticket=ticket), web2py_error='ticket %s' % ticket) session._unlock(response) http_response = rewrite.try_redirect_on_error(http_response, request.application, ticket) return http_response.to(responder) def save_password(password, port): """ used by main() to save the password in the parameters.py file. """ password_file='parameters_%i.py' % port if password == '<recycle>': if os.path.exists(password_file): return else: password = '' fp = open(password_file, 'w')
e = RestrictedError('Framework', '', '', locals()) ticket = e.log(request) or 'unrecoverable' http_response = \ HTTP(500, rewrite.thread.routes.error_message_ticket % dict(ticket=ticket), web2py_error='ticket %s' % ticket) finally: if response and hasattr(response, 'session_file') and response.session_file: response.session_file.close() # if global_settings.debugging: # import gluon.debug # gluon.debug.stop_trace() session._unlock(response) http_response = rewrite.try_redirect_on_error(http_response,request,ticket) if global_settings.web2py_crontype == 'soft': newcron.softcron(global_settings.applications_parent).start() return http_response.to(responder) def save_password(password, port): """ used by main() to save the password in the parameters_port.py file. """ password_file = abspath('parameters_%i.py' % port) if password == '<random>': # make up a new password chars = string.letters + string.digits password = ''.join([random.choice(chars) for i in range(8)])
HTTP(500, rewrite.thread.routes.error_message_ticket % dict(ticket=ticket), web2py_error='ticket %s' % ticket) finally: if response and hasattr(response, 'session_file') and response.session_file: response.session_file.close() # if global_settings.debugging: # import gluon.debug # gluon.debug.stop_trace() session._unlock(response) http_response = rewrite.try_redirect_on_error(http_response, request, ticket) if global_settings.web2py_crontype == 'soft': newcron.softcron(global_settings.applications_parent).start() return http_response.to(responder) def save_password(password, port): """ used by main() to save the password in the parameters_port.py file. """ password_file = abspath('parameters_%i.py' % port) if password == '<random>': # make up a new password chars = string.letters + string.digits password = ''.join([random.choice(chars) for i in range(8)])