def destroy_context(self): destroy_context()
fallback=self.env.fallback, delegate=self.env.delegate) if client_ip is not None: setattr(context, "client_ip", client_ip) def destroy_context(self): destroy_context() def execute(self, _name, *args, **options): error = None try: if _name not in self.Command: raise CommandError(name=_name) result = self.Command[_name](*args, **options) except PublicError, e: error = e except StandardError, e: self.exception( 'non-public: %s: %s', e.__class__.__name__, str(e) ) error = InternalError() except Exception, e: self.exception( 'unhandled exception: %s: %s', e.__class__.__name__, str(e) ) error = InternalError() destroy_context() if error is None: return result assert isinstance(error, PublicError) raise error #pylint: disable=E0702