aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-11-29 15:33:32 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2015-11-29 15:35:19 -0800
commitbdc6e2291fd03d2bcb3c5068e82b5a54d79dbd80 (patch)
treece5b3a9e86a9a972c77bbe2d18affe19929781ec /gen-report-xml.py
parentInitial commit. (diff)
downloadmastermirror-scripts-bdc6e2291fd03d2bcb3c5068e82b5a54d79dbd80.tar.gz
mastermirror-scripts-bdc6e2291fd03d2bcb3c5068e82b5a54d79dbd80.tar.bz2
mastermirror-scripts-bdc6e2291fd03d2bcb3c5068e82b5a54d79dbd80.zip
py2to3 fixes.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'gen-report-xml.py')
-rwxr-xr-xgen-report-xml.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/gen-report-xml.py b/gen-report-xml.py
index a1abe72..dc12a47 100755
--- a/gen-report-xml.py
+++ b/gen-report-xml.py
@@ -127,7 +127,7 @@ with io.open(scheduled_deletions_log, mode='r', encoding='utf_8') as f:
pass
cur_ep = time.strftime("%s", time.strptime(time.strftime("%Y-%m-%d",time.gmtime()), "%Y-%m-%d"))
-l=del_list.keys()
+l=list(del_list.keys())
l.sort()
while len(l) and cur_ep > l[0]:
del del_list[l[0]]
@@ -135,7 +135,7 @@ while len(l) and cur_ep > l[0]:
slated_for_death_total = 0
for x in l: slated_for_death_total += del_totals[x]
-f_len=max(len(str(len(dist_files.keys()))), len(str(del_count)))
+f_len=max(len(str(len(list(dist_files.keys())))), len(str(del_count)))
dist_sum=sum(dist_files.values())
d_len = max(len(str(dist_sum)), len(str(slated_for_death_total)))
@@ -152,9 +152,9 @@ outf.write("""<?xml version='1.0'?>
%s bytes: %s files: Slated for deletion<br/>
Added %i files since beginning of day (UTC)<br/>
Removed %i files in last run</p></body></section></chapter>""" % \
-(time.strftime("%A %b %d %Y, %H:%M:%S UTC", time.gmtime()), str(dist_sum).rjust(d_len), str(len(dist_files.keys())).rjust(f_len),
+(time.strftime("%A %b %d %Y, %H:%M:%S UTC", time.gmtime()), str(dist_sum).rjust(d_len), str(len(list(dist_files.keys()))).rjust(f_len),
str(slated_for_death_total).rjust(d_len), str(del_count).rjust(f_len),
-sum([len(x) for x in added_files.values()]), sum([len(x) for x in removed_files.values()])))
+sum([len(x) for x in list(added_files.values())]), sum([len(x) for x in list(removed_files.values())])))
dist_files.clear()
outf.write("""
@@ -171,7 +171,7 @@ more likely then not broke in some fashion even if the maintainer isn't aware of
#quote stripping is needed.
-esort = failed_ebuilds.keys()
+esort = list(failed_ebuilds.keys())
esort.sort()
for cpv in esort:
for f,r in failed_ebuilds[cpv]:
@@ -182,7 +182,7 @@ outf.write("</table>\n")
outf.write("""</body></section></chapter>
<chapter><title>Files Added</title><section><body><table><tr><th>Ebuild</th><th>File</th></tr>\n""")
-added_s = added_files.keys()
+added_s = list(added_files.keys())
added_s.sort()
for cpv in added_s:
added_files[cpv].sort()
@@ -192,7 +192,7 @@ for cpv in added_s:
outf.write("""</table></body></section></chapter>
<chapter><title>Files Removed</title><section><body><table><tr><th>Ebuild</th><th>File</th></tr>\n\n""")
-rem_s = removed_files.keys()
+rem_s = list(removed_files.keys())
rem_s.sort()
for cpv in rem_s:
removed_files[cpv].sort()
@@ -208,17 +208,17 @@ for cpv in rem_s:
outf.write("""</table></body></section></chapter>
<chapter><title>Scheduled Deletions</title><section><body>\n<ul>""")
-l=del_list.keys()
+l=list(del_list.keys())
l.sort()
for date in l:
outf.write(""" <li><uri link="#%s">%s</uri>, %i files for %i bytes</li>\n""" % (date, time.strftime("%B %d %Y",
- time.gmtime(float(date))), sum([len(x) for x in del_list[date].values()]), del_totals[date]))
+ time.gmtime(float(date))), sum([len(x) for x in list(del_list[date].values())]), del_totals[date]))
outf.write("</ul></body></section>\n")
for date in l:
outf.write("""<section id="%s"><title>Deletions for %s</title>
<body><table><tr><th>Ebuild (If known)</th><th>File</th></tr>\n""" % (date, time.strftime("%A %B %d %Y", time.gmtime(float(date)))))
- cpvs = del_list[date].keys()
+ cpvs = list(del_list[date].keys())
cpvs.sort()
for cpv in cpvs:
l=del_list[date][cpv]
@@ -233,7 +233,7 @@ outf.write("<chapter><title>White Lists</title>")
if not whitelist:
outf.write("<section><body><p><uri link=\"whitelists.xml\">Whitelist Report</uri></p></body></section>")
#outf.write("<section><body><p>No whitelists.</p></body></section>")
-l=whitelist.keys()
+l=list(whitelist.keys())
l.sort()
for x in l:
outf.write("<section><title>%s</title><body><ul>\n" % os.path.basename(x))