about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicho Healey <richo@psych0tik.net>2015-01-27 01:11:38 -0800
committerRicho Healey <richo@psych0tik.net>2015-01-27 01:26:03 -0800
commita4ab5e59a795bf2d736cd6436ba85685b479807b (patch)
tree10f5e36465584bb9fb7776c24e74431ab645f5ff
parent109a6bc86c110751118307b969616319d8ed795b (diff)
downloadrust-a4ab5e59a795bf2d736cd6436ba85685b479807b.tar.gz
rust-a4ab5e59a795bf2d736cd6436ba85685b479807b.zip
Fix PEP8 for latest-unix-snaps.py
-rwxr-xr-xsrc/etc/latest-unix-snaps.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/etc/latest-unix-snaps.py b/src/etc/latest-unix-snaps.py
index 32e9691f815..6c93bf23f90 100755
--- a/src/etc/latest-unix-snaps.py
+++ b/src/etc/latest-unix-snaps.py
@@ -10,7 +10,8 @@
 # option. This file may not be copied, modified, or distributed
 # except according to those terms.
 
-import os, tarfile, hashlib, re, shutil, sys
+import os
+import re
 from snapshot import *
 
 f = open(snapshotfile)
@@ -26,7 +27,8 @@ newestSet = {}
 for line in f.readlines():
     i += 1
     parsed = parse_line(i, line)
-    if (not parsed): continue
+    if not parsed:
+        continue
 
     if parsed["type"] == "snapshot":
         if (len(newestSet) == 0 or parsed["date"] > newestSet["date"]):
@@ -37,16 +39,16 @@ for line in f.readlines():
         else:
             addingMode = False
 
-    elif addingMode == True and parsed["type"] == "file":
+    elif addingMode is True and parsed["type"] == "file":
         tux = re.compile("linux", re.IGNORECASE)
-        if (tux.match(parsed["platform"]) != None):
-           ff = {}
-           ff["platform"] = parsed["platform"]
-           ff["hash"] = parsed["hash"]
-           newestSet["files"] += [ff]
+        if (tux.match(parsed["platform"]) is not None):
+            ff = {}
+            ff["platform"] = parsed["platform"]
+            ff["hash"] = parsed["hash"]
+            newestSet["files"] += [ff]
 
 
-def download_new_file (date, rev, platform, hsh):
+def download_new_file(date, rev, platform, hsh):
         snap = full_snapshot_name(date, rev, platform, hsh)
         dl = os.path.join(download_dir_base, snap)
         url = download_url_base + "/" + snap
@@ -59,5 +61,5 @@ def download_new_file (date, rev, platform, hsh):
             raise Exception("bad hash on download")
 
 for ff in newestSet["files"]:
-   download_new_file (newestSet["date"], newestSet["rev"],
+    download_new_file(newestSet["date"], newestSet["rev"],
                       ff["platform"], ff["hash"])