]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/makechangelog.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Demo / pdist / makechangelog.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/makechangelog.py b/AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/makechangelog.py
deleted file mode 100644 (file)
index 2f5519f..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#! /usr/bin/env python\r
-\r
-"""Turn a pile of RCS log output into ChangeLog file entries.\r
-\r
-"""\r
-\r
-import sys\r
-import string\r
-import re\r
-import getopt\r
-import time\r
-\r
-def main():\r
-    args = sys.argv[1:]\r
-    opts, args = getopt.getopt(args, 'p:')\r
-    prefix = ''\r
-    for o, a in opts:\r
-        if p == '-p': prefix = a\r
-\r
-    f = sys.stdin\r
-    allrevs = []\r
-    while 1:\r
-        file = getnextfile(f)\r
-        if not file: break\r
-        revs = []\r
-        while 1:\r
-            rev = getnextrev(f, file)\r
-            if not rev:\r
-                break\r
-            revs.append(rev)\r
-        if revs:\r
-            allrevs[len(allrevs):] = revs\r
-    allrevs.sort()\r
-    allrevs.reverse()\r
-    for rev in allrevs:\r
-        formatrev(rev, prefix)\r
-\r
-parsedateprog = re.compile(\r
-    '^date: ([0-9]+)/([0-9]+)/([0-9]+) ' +\r
-    '([0-9]+):([0-9]+):([0-9]+);  author: ([^ ;]+)')\r
-\r
-authormap = {\r
-    'guido': 'Guido van Rossum  <guido@cnri.reston.va.us>',\r
-    'jack': 'Jack Jansen  <jack@cwi.nl>',\r
-    'sjoerd': 'Sjoerd Mullender  <sjoerd@cwi.nl>',\r
-    }\r
-\r
-def formatrev(rev, prefix):\r
-    dateline, file, revline, log = rev\r
-    if parsedateprog.match(dateline) >= 0:\r
-        fields = parsedateprog.group(1, 2, 3, 4, 5, 6)\r
-        author = parsedateprog.group(7)\r
-        if authormap.has_key(author): author = authormap[author]\r
-        tfields = map(string.atoi, fields) + [0, 0, 0]\r
-        tfields[5] = tfields[5] - time.timezone\r
-        t = time.mktime(tuple(tfields))\r
-        print time.ctime(t), '', author\r
-        words = string.split(log)\r
-        words[:0] = ['*', prefix + file + ':']\r
-        maxcol = 72-8\r
-        col = maxcol\r
-        for word in words:\r
-            if col > 0 and col + len(word) >= maxcol:\r
-                print\r
-                print '\t' + word,\r
-                col = -1\r
-            else:\r
-                print word,\r
-            col = col + 1 + len(word)\r
-        print\r
-        print\r
-\r
-startprog = re.compile("^Working file: (.*)$")\r
-\r
-def getnextfile(f):\r
-    while 1:\r
-        line = f.readline()\r
-        if not line: return None\r
-        if startprog.match(line) >= 0:\r
-            file = startprog.group(1)\r
-            # Skip until first revision\r
-            while 1:\r
-                line = f.readline()\r
-                if not line: return None\r
-                if line[:10] == '='*10: return None\r
-                if line[:10] == '-'*10: break\r
-##              print "Skipped", line,\r
-            return file\r
-##      else:\r
-##          print "Ignored", line,\r
-\r
-def getnextrev(f, file):\r
-    # This is called when we are positioned just after a '---' separator\r
-    revline = f.readline()\r
-    dateline = f.readline()\r
-    log = ''\r
-    while 1:\r
-        line = f.readline()\r
-        if not line: break\r
-        if line[:10] == '='*10:\r
-            # Ignore the *last* log entry for each file since it\r
-            # is the revision since which we are logging.\r
-            return None\r
-        if line[:10] == '-'*10: break\r
-        log = log + line\r
-    return dateline, file, revline, log\r
-\r
-if __name__ == '__main__':\r
-    main()\r