Merge ubuntu-sponsoring:subdir-for-jsons into ubuntu-sponsoring:master

Proposed by Sebastien Bacher
Status: Merged
Merged at revision: 2eaec701ab7959b7f1c2fe0748ed78c9d78b172d
Proposed branch: ubuntu-sponsoring:subdir-for-jsons
Merge into: ubuntu-sponsoring:master
Diff against target: 22 lines (+9/-2)
1 file modified (+9/-2)
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email:

Commit message

Write the json reports in a subdir

It's easier to list them this way. Keep the old location for compatibility

Description of the change

Currently browsing loads the index.html. I'm working on creating some sponsoring KPI and it would be nice to be able to iterate over the records from a directory rather than coding the list of filename.

The reports are also still written to the old location for compatibility reasons in case other scripts or service rely on the current url.

I've deleted the remove use since opening the file in 'w' mode is enough to replace the content

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

This looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/ b/
2index e2d76a6..6c06437 100755
3--- a/
4+++ b/
5@@ -568,8 +568,15 @@ def generate_page(items, devs, packages, other_teams=[], team=None):
6 json_items = []
7 for item in items:
8 json_items += [item.prepare_json()]
9- if os.path.exists(json_filename):
10- os.remove(json_filename)
12+ # create a subdir for the json reports
13+ if not os.path.exists("jsons"):
14+ os.mkdir("jsons")
15+ f = open(os.path.join("jsons", json_filename), "w")
16+ f.write(json.dumps(json_items))
17+ f.close()
19+ # still write to the old location for compatibility
20 f = open(json_filename, "w")
21 f.write(json.dumps(json_items))
22 f.close()


People subscribed via source and target branches

to all changes: