def stateful_pin_message(self, call):
if isinstance(call.func, ast.Attribute):
if call.func.attr == 'pin_message':
if self.interactive and not prompt_change(
'A possible change was found to make {} stateful.'.format(call.func.attr)
):
return call
message = call.args[0]
call.func.value = message
call.func.attr = 'pin'
call.args = []
elif call.func.attr == 'unpin_message':
if self.interactive and not prompt_change(
'A possible change was found to make {} stateful.'.format(call.func.attr)
):
return call
message = call.args[0]
call.func.value = message
call.func.attr = 'unpin'
call.args = []
stats_counter['call_changes'] += 1
return call
评论列表
文章目录