]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/ptags.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Tools / scripts / ptags.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/ptags.py b/AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/ptags.py
deleted file mode 100644 (file)
index 9626b71..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /usr/bin/env python\r
-\r
-# ptags\r
-#\r
-# Create a tags file for Python programs, usable with vi.\r
-# Tagged are:\r
-# - functions (even inside other defs or classes)\r
-# - classes\r
-# - filenames\r
-# Warns about files it cannot open.\r
-# No warnings about duplicate tags.\r
-\r
-import sys, re, os\r
-\r
-tags = []    # Modified global variable!\r
-\r
-def main():\r
-    args = sys.argv[1:]\r
-    for filename in args:\r
-        treat_file(filename)\r
-    if tags:\r
-        fp = open('tags', 'w')\r
-        tags.sort()\r
-        for s in tags: fp.write(s)\r
-\r
-\r
-expr = '^[ \t]*(def|class)[ \t]+([a-zA-Z0-9_]+)[ \t]*[:\(]'\r
-matcher = re.compile(expr)\r
-\r
-def treat_file(filename):\r
-    try:\r
-        fp = open(filename, 'r')\r
-    except:\r
-        sys.stderr.write('Cannot open %s\n' % filename)\r
-        return\r
-    base = os.path.basename(filename)\r
-    if base[-3:] == '.py':\r
-        base = base[:-3]\r
-    s = base + '\t' + filename + '\t' + '1\n'\r
-    tags.append(s)\r
-    while 1:\r
-        line = fp.readline()\r
-        if not line:\r
-            break\r
-        m = matcher.match(line)\r
-        if m:\r
-            content = m.group(0)\r
-            name = m.group(2)\r
-            s = name + '\t' + filename + '\t/^' + content + '/\n'\r
-            tags.append(s)\r
-\r
-if __name__ == '__main__':\r
-    main()\r