From: lottaviano Date: Thu, 2 Jul 2009 09:25:24 +0000 (+0000) Subject: doc: Improve and rename tag filter script X-Git-Tag: 2.2.0~244 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=1bf0311c2851e336feaae20b841bac20579fbc8f;p=bertos.git doc: Improve and rename tag filter script Remove 'notest:' tags. Use a more generic name. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2724 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/doc/tag-filter.py b/doc/tag-filter.py new file mode 100644 index 00000000..059d0181 --- /dev/null +++ b/doc/tag-filter.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +from __future__ import with_statement +import re, sys + +def remove_expr(regex, line): + new_line = re.sub(regex, "", line) + sys.stdout.write(new_line) + +if __name__ == "__main__": + wiz = re.compile(r"\$WIZ\$.*$") + notest = re.compile(r'notest:.*$') + with file(sys.argv[1]) as f: + for line in f: + if re.search(wiz, line) != None: + remove_expr(wiz, line) + elif re.search(notest, line) != None: + remove_expr(notest, line) + else: + sys.stdout.write(line)