(self, request, action, failed_msg, kwargs=None)
调用微信请求action
调用微信请求action
调用微信请求action
def _clientaction(self, request, action, failed_msg, kwargs=None):
        """调用微信请求action"""
        kwargs = kwargs or dict()
        try:
            msg = action()
            self.message_user(request, msg)
        except Exception as e:
            kwargs.update(exc=e)
            msg = failed_msg % kwargs
            if isinstance(e, WeChatClientException):
                request.app.logger("admin").warning(msg, exc_info=True)
            else:
                request.app.logger("admin").error(msg, exc_info=True)
            self.message_user(request, msg, level=messages.ERROR)
def _clientaction ( self , request , action , failed_msg , kwargs = None ) : kwargs = kwargs or dict ( ) try : msg = action ( ) self . message_user ( request , msg ) except Exception as e : kwargs . update ( exc = e ) msg = failed_msg % kwargs if isinstance ( e , WeChatClientException ) : request . app . logger ( "admin" ) . warning ( msg , exc_info = True ) else : request . app . logger ( "admin" ) . error ( msg , exc_info = True ) self . message_user ( request , msg , level = messages . ERROR )