def delete_tc(self):
rule_finder = TcShapingRuleFinder(logger=logger, tc=self)<EOL>filter_param = rule_finder.find_filter_param()<EOL>if not filter_param:<EOL><INDENT>message = "<STR_LIT>".format(rule_finder.get_filter_string())<EOL>if rule_finder.is_empty_filter_condition():<EOL><INDENT>message += "<STR_LIT>"<EOL><DEDENT>logger.error(message)<EOL>return <NUM_LIT:1><EOL><DEDENT>logger.info("<STR_LIT>".format(dict(filter_param)))<EOL>filter_del_command = (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>command=get_tc_base_command(TcSubCommand.FILTER),<EOL>dev=rule_finder.get_parsed_device(),<EOL>protocol=filter_param.get(Tc.Param.PROTOCOL),<EOL>parent="<STR_LIT>".format(rule_finder.find_parent().split("<STR_LIT::>")[<NUM_LIT:0>]),<EOL>handle=filter_param.get(Tc.Param.FILTER_ID),<EOL>prio=filter_param.get(Tc.Param.PRIORITY),<EOL>)<EOL>)<EOL>result = run_command_helper(<EOL>command=filter_del_command, ignore_error_msg_regexp=None, notice_msg=None<EOL>)<EOL>rule_finder.clear()<EOL>if not rule_finder.is_any_filter():<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>self.delete_all_tc()<EOL><DEDENT>return result<EOL>
Delete a specific shaping rule.