From bc9b5b18da5f17dc7ec0d026f72127db4b8befbd Mon Sep 17 00:00:00 2001 From: norvell Date: Tue, 17 Jan 2023 13:08:56 +0000 Subject: [PATCH] Delete unused file strsub_wmc_skip.py --- scripts/strsub_wmc_skip.py | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 scripts/strsub_wmc_skip.py diff --git a/scripts/strsub_wmc_skip.py b/scripts/strsub_wmc_skip.py deleted file mode 100644 index 4c4bfab64b..0000000000 --- a/scripts/strsub_wmc_skip.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/python3 - -import argparse -import re - -parser = argparse.ArgumentParser(description='Substitute strings in files, skipping blocks in WMC_TOOL_SKIP') -parser.add_argument('input',type=str,help='C source file') -parser.add_argument('target',type=str,help='Target string to replace') -parser.add_argument('dest',type=str,help='Destination string to insert') -args = parser.parse_args() -fileIn = args.input -target = args.target -dest = args.dest - -skip = 0 - -with open(fileIn, 'r') as f_in: - lines = f_in.readlines() -with open(fileIn, 'w') as f_out: - for line in lines: - if re.search(r'#define\W+WMC_TOOL_SKIP', line): - skip = 1 - elif re.search(r'#undef\W+WMC_TOOL_SKIP', line): - skip = 0 - else: - if not skip: - line = re.sub(r'\b%s\b' % (target), '%s' % (dest), line) - f_out.write(line) \ No newline at end of file -- GitLab