From a878b433806551203c114a9fc5ce494453e1c4f1 Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Fri, 29 Mar 2013 17:18:29 +0100 Subject: [PATCH] Support status.openstack.org header/footer Add a openstack_status magic parameter in config.js which toggles the use of openstack-specific CSS and JS files to better integrate in status.openstack.org. --- bugdaystats.py | 5 +++-- templates/index.html | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/bugdaystats.py b/bugdaystats.py index 984fef6..9384856 100755 --- a/bugdaystats.py +++ b/bugdaystats.py @@ -29,7 +29,8 @@ def create_files(templatepath, outputpath, projects): indexfile = os.path.join(outputpath, "index.html") if not os.path.exists(indexfile): template = env.get_template('index.html') - template.stream(projects=projects).dump(indexfile) + template.stream(projects=projects, + openstack_status=openstack_status).dump(indexfile) # Create each project file for project in projects: @@ -57,7 +58,6 @@ def update_stats(outputpath, project_name, rotation): for record in json_data['records']: if rotation: if (now - record['date']) > (rotation * 24 * 60 * 60): - print "skip" continue records.append(record) except IOError: @@ -162,6 +162,7 @@ if __name__ == '__main__': config = json.load(configfile) projects = config['projects'] rotation = config.get('rotation') + openstack_status = config.get('openstack_status') # Create files in output directory, if needed create_files(templatepath, outputpath, projects) diff --git a/templates/index.html b/templates/index.html index 378eb7f..d5c6592 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,5 +1,20 @@ Bugsquashing day stats +{% if openstack_status %} + + + + + + +{% endif %}

Bugsquashing day stats

{% for project in projects %} @@ -15,4 +30,7 @@ {% endfor %}
+{% if openstack_status %} + +{% endif %}