Commits

Dan Buch committed e0d072b

Moving dev scripts into their own dir, futzing with paths a bit

  • Participants
  • Parent commits 7fc2c4b

Comments (0)

Files changed (4)

File devscripts/fetch-reindent-versions

+#!/bin/bash
+
+TOP=$(dirname $(dirname $(readlink -f $0)))
+REPO_BASE="http://hg.python.org/cpython-fullhistory"
+
+for tag in "2.3.7" "2.4.6" "2.5.5" "2.6.6" "2.7.1" "3.0.1" "3.1.3" "3.2"
+do
+    vnum="v$(echo $tag | sed 's/\.//g' | cut -b 1-2)"
+    dest="${TOP}/reindent/${vnum}/reindent.py"
+    dl_url="${REPO_BASE}/raw-file/v${tag}/Tools/scripts/reindent.py"
+    echo "Downloading ${dl_url} to ${dest}"
+    curl "${dl_url}" > "${dest}" 2>/dev/null
+done

File devscripts/test-python-versions

+#!/usr/bin/env python
+"""
+This is a very crude version compatibility script that cycles through a bunch
+of python versions likely (???) to still be in use.  The script itself has only
+been tested on linux, so any feedback from users on other platforms is much
+appreciated.
+"""
+from __future__ import print_function
+
+import sys
+from os.path import dirname, abspath, join as pathjoin
+from subprocess import check_call, PIPE
+
+
+VERSIONS = ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
+REINDENT_SCRIPT = pathjoin(
+    dirname(dirname(abspath(__file__))), 'scripts', 'reindent'
+)
+
+
+def main():
+    had_failure = False
+    passes = 0
+
+    for version in VERSIONS:
+        exe = 'python{0}'.format(version)
+
+        try:
+            check_call([exe, '-c', 'import sys'], stdout=PIPE, stderr=PIPE)
+            print('+ Testing {0}'.format(exe), end='')
+
+            try:
+                check_call([exe, REINDENT_SCRIPT, '-h'],
+                           stdout=PIPE, stderr=PIPE)
+                # yes, it is *hilarious* that I'm using tabs in a script to
+                # test `reindent`
+                print('\t\tPASS')
+                passes += 1
+
+            except OSError:
+                had_failure = True
+                print('\t\tFAIL')
+
+        except OSError:
+            print('- {0} not detected\tSKIP'.format(exe))
+
+    print('=' * 36)
+    print('Summary: ', end='')
+
+    if had_failure:
+        print('FAIL')
+    else:
+        print('PASS ({0}% awesomeness)'.format(
+            int(100 * (float(passes) / float(len(VERSIONS))))))
+
+
+if __name__ == '__main__':
+    sys.exit(main())

File fetch-reindent-versions

-#!/bin/bash
-
-HERE=$(dirname $(readlink -f $0))
-REPO_BASE="http://hg.python.org/cpython-fullhistory"
-
-for tag in "2.3.7" "2.4.6" "2.5.5" "2.6.6" "2.7.1" "3.0.1" "3.1.3" "3.2"
-do
-    vnum="v$(echo $tag | sed 's/\.//g' | cut -b 1-2)"
-    dest="${HERE}/reindent/${vnum}/reindent.py"
-    curl -o "${dest}" "${REPO_BASE}/raw-file/v${tag}/Tools/scripts/reindent.py"
-done

File test-python-versions

-#!/usr/bin/env python
-"""
-This is a very crude version compatibility script that cycles through a bunch
-of python versions likely (???) to still be in use.  The script itself has only
-been tested on linux, so any feedback from users on other platforms is much
-appreciated.
-"""
-from __future__ import print_function
-
-import sys
-import os
-from subprocess import check_call, PIPE
-
-
-HERE = os.path.dirname(os.path.abspath(__file__))
-VERSIONS = ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
-
-
-def main():
-    had_failure = False
-    passes = 0
-    reindent_script = os.path.join(HERE, 'scripts', 'reindent')
-    for version in VERSIONS:
-        exe = 'python{0}'.format(version)
-        try:
-            check_call([exe, '-c', 'import sys'], stdout=PIPE, stderr=PIPE)
-            print('+ Testing {0}'.format(exe), end='')
-            try:
-                check_call([exe, reindent_script, '-h'],
-                           stdout=PIPE, stderr=PIPE)
-                # yes, it is *hilarious* that I'm using tabs in a script to
-                # test `reindent`
-                print('\t\tPASS')
-                passes += 1
-            except OSError:
-                had_failure = True
-                print('\t\tFAIL')
-        except OSError:
-            print('- {0} not detected\tSKIP'.format(exe))
-
-    print('=' * 36)
-    print('Summary: ', end='')
-
-    if had_failure:
-        print('FAIL')
-    else:
-        print('PASS ({0}% awesomeness)'.format(
-            int(100 * (float(passes) / float(len(VERSIONS))))))
-
-
-if __name__ == '__main__':
-    sys.exit(main())