Commits

Dan Buch committed 2c61743

Renaming scripts for clarity, cross-platform-y-ness and importability

Comments (0)

Files changed (4)

devscripts/download_reindent.py

+#!/usr/bin/env python
+from __future__ import print_function
+
+import sys
+from os.path import dirname, abspath, join as pathjoin
+from urllib2 import urlopen
+
+TOP = dirname(dirname(abspath(__file__)))
+REPO_BASE = "http://hg.python.org/cpython-fullhistory"
+TAGS_VERSIONS = {
+    '2.3.7': '23',
+    '2.4.6': '24',
+    '2.5.5': '25',
+    '2.6.6': '26',
+    '2.7.1': '27',
+    '3.0.1': '30',
+    '3.1.3': '31',
+    '3.2': '32'
+}
+
+
+def main():
+    for tag, vnum in TAGS_VERSIONS.items():
+        try:
+            dest = "{TOP}/reindent/v{vnum}/reindent.py".format(TOP=TOP, vnum=vnum)
+            dl_url = \
+                "{REPO_BASE}/raw-file/v{tag}/Tools/scripts/reindent.py".format(
+                    REPO_BASE=REPO_BASE,
+                    tag=tag
+                )
+            print("Downloading {dl_url} to {dest}".format(
+                dl_url=dl_url, dest=dest)
+            )
+
+            with open(dest, 'w') as outfile:
+                outfile.write(urlopen(dl_url).read())
+        except Exception:
+            return 1
+
+    return 0
+
+
+if __name__ == '__main__':
+    sys.exit(main())

devscripts/fetch-reindent-versions

-#!/usr/bin/env python
-from __future__ import print_function
-
-import sys
-from os.path import dirname, abspath, join as pathjoin
-from urllib2 import urlopen
-
-TOP = dirname(dirname(abspath(__file__)))
-REPO_BASE = "http://hg.python.org/cpython-fullhistory"
-TAGS_VERSIONS = {
-    '2.3.7': '23',
-    '2.4.6': '24',
-    '2.5.5': '25',
-    '2.6.6': '26',
-    '2.7.1': '27',
-    '3.0.1': '30',
-    '3.1.3': '31',
-    '3.2': '32'
-}
-
-
-def main():
-    for tag, vnum in TAGS_VERSIONS.items():
-        try:
-            dest = "{TOP}/reindent/v{vnum}/reindent.py".format(TOP=TOP, vnum=vnum)
-            dl_url = \
-                "{REPO_BASE}/raw-file/v{tag}/Tools/scripts/reindent.py".format(
-                    REPO_BASE=REPO_BASE,
-                    tag=tag
-                )
-            print("Downloading {dl_url} to {dest}".format(
-                dl_url=dl_url, dest=dest)
-            )
-
-            with open(dest, 'w') as outfile:
-                outfile.write(urlopen(dl_url).read())
-        except Exception:
-            return 1
-
-    return 0
-
-
-if __name__ == '__main__':
-    sys.exit(main())

devscripts/smoketest.py

+#!/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())

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())