doc: Improve and rename tag filter script
authorlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 2 Jul 2009 09:25:24 +0000 (09:25 +0000)
committerlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 2 Jul 2009 09:25:24 +0000 (09:25 +0000)
Remove 'notest:' tags.
Use a more generic name.

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2724 38d2e660-2303-0410-9eaa-f027e97ec537

doc/tag-filter.py [new file with mode: 0644]

diff --git a/doc/tag-filter.py b/doc/tag-filter.py
new file mode 100644 (file)
index 0000000..059d018
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/env python\r
+from __future__ import with_statement\r
+import re, sys\r
+\r
+def remove_expr(regex, line):\r
+       new_line = re.sub(regex, "", line)\r
+       sys.stdout.write(new_line)\r
+\r
+if __name__ == "__main__":\r
+    wiz = re.compile(r"\$WIZ\$.*$")\r
+    notest = re.compile(r'notest:.*$')\r
+    with file(sys.argv[1]) as f:\r
+        for line in f:\r
+            if re.search(wiz, line) != None:\r
+                remove_expr(wiz, line)\r
+            elif re.search(notest, line) != None:\r
+                remove_expr(notest, line)\r
+            else:\r
+                sys.stdout.write(line)\r