summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'BuildTools/Gource')
-rwxr-xr-xBuildTools/Gource/GetGravatars.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/BuildTools/Gource/GetGravatars.py b/BuildTools/Gource/GetGravatars.py
index d1f40a4..17198aa 100755
--- a/BuildTools/Gource/GetGravatars.py
+++ b/BuildTools/Gource/GetGravatars.py
@@ -5,7 +5,7 @@ import subprocess, os, sys, hashlib, urllib
GRAVATAR_URL = "http://www.gravatar.com/avatar/%(id)s?d=404"
if len(sys.argv) != 2 :
- print "Usage: " + sys.argv[0] + " <output-dir>"
+ print("Usage: " + sys.argv[0] + " <output-dir>")
sys.exit(-1)
output_dir = sys.argv[1]
@@ -18,32 +18,32 @@ for line in p.stdout.readlines() :
authors[author_components[0]] = author_components[1]
p.stdin.close()
if p.wait() != 0 :
- print "Error"
+ print("Error")
sys.exit(-1)
# Get & save the avatars
if not os.path.isdir(output_dir) :
os.makedirs(output_dir)
for email, name in authors.items() :
- print "Processing avatar for " + name + " <" + email + ">"
+ print("Processing avatar for " + name + " <" + email + ">")
filename = os.path.join(output_dir, name + ".png")
if os.path.isfile(filename) :
- print "-> Already there. Skipping."
+ print("-> Already there. Skipping.")
continue
m = hashlib.md5()
m.update(email)
url = GRAVATAR_URL % {"id" : m.hexdigest()}
- print "- Downloading " + url
+ print("- Downloading " + url)
f = urllib.urlopen(url)
input = None
if f.getcode() == 200 :
input = f.read()
f.close()
if input :
- print "- Saving file " + filename
+ print("- Saving file " + filename)
f = open(filename, "w")
f.write(input)
f.close()
else :
- print "- No Gravatar found"
+ print("- No Gravatar found")