Skip to content

Commit

Permalink
Fix PEP8 for latest-unix-snaps.py
Browse files Browse the repository at this point in the history
  • Loading branch information
richo committed Jan 27, 2015
1 parent 109a6bc commit a4ab5e5
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/etc/latest-unix-snaps.py
Expand Up @@ -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)
Expand All @@ -26,7 +27,8 @@
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"]):
Expand All @@ -37,16 +39,16 @@
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
Expand All @@ -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"])

0 comments on commit a4ab5e5

Please sign in to comment.