diff --git a/.arclint b/.arclint index 36d7633..a661aef 100644 --- a/.arclint +++ b/.arclint @@ -1,8 +1,9 @@ { - "exclude": "(^LICENSE)", + "exclude": "(^LICENSE|.gitignore)", "linters": { - "sample": { - "type": "flake8" + "python": { + "type": "flake8", + "exclude": "(\\.html$)" } } } diff --git a/metrics b/metrics index afdb30c..959ed35 100755 --- a/metrics +++ b/metrics @@ -117,19 +117,19 @@ if __name__ == "__main__": # Parse CLI arguments parser = argparse.ArgumentParser() parser.add_argument("--db-location", type=str, default=":memory:", - help="Specify the location for the SQLite database") + help="Specify the location for the SQLite database") parser.add_argument("--log", type=str, default="WARNING", - help="Default logging level") + help="Default logging level") args = parser.parse_args() # Ensure the logging level is set properly num_level = getattr(log, args.log.upper(), None) if not isinstance(num_level, int): - raise ValueError("Invalid log level: %s" % loglevel) + raise ValueError("Invalid log level: %s" % args.log) # Fully configure the logger log.basicConfig(format="%(asctime)s\t%(levelname)s\t%(message)s", - level=num_level) + level=num_level) # Initialize a dict to store data for the summary page summary_page = {} diff --git a/modules/jenkins.py b/modules/jenkins.py index cff5e06..68d5e87 100755 --- a/modules/jenkins.py +++ b/modules/jenkins.py @@ -188,7 +188,7 @@ class JenkinsModule: # Write it back to the filename in the output dir with open(path.join("output", "jenkins_%sdays.html" % days), - "w+") as f: + "w+") as f: f.write(template) # Return the averages for use in the summary diff --git a/templates/index.html b/templates/index.html index 52b0de2..b937b49 100644 --- a/templates/index.html +++ b/templates/index.html @@ -5,15 +5,11 @@ - +
-
-
-
-

Summary for Lubuntu Project Metrics

@@ -22,13 +18,13 @@

Jenkins Data

- +
- - - + + + @@ -37,9 +33,9 @@ {% for avg in page.Jenkins[day] %} - {% endfor %} + {% endfor %} - {% endfor %} + {% endfor %}
Time (days)Average FailingAverage Non-passingAverage TotalAverage FailingAverage Non-passingAverage Total
{{ day }}{{ avg }}
diff --git a/templates/jenkins.html b/templates/jenkins.html index f9ee53f..10e0a0e 100644 --- a/templates/jenkins.html +++ b/templates/jenkins.html @@ -8,15 +8,11 @@ - +
-
-
-
-

Jenkins data for the past {{ days }} day(s)

@@ -34,58 +30,58 @@ var myChart = new Chart(ctx, { type: 'line', data: { - datasets: [ - { - label: 'Failing Jobs', - backgroundColor: "#FF0000", - //borderColor: "#FF0000", - data: [ - {% for timestamp, num in jenkins.failing %} - { - t: new Date({{ timestamp }} * 1000), - y: {{ num }} - }, - {% endfor %} - ] - }, - { - label: 'Non-passing Jobs', - backgroundColor: "#FFFF00", - //borderColor: "#FFFF00", - data: [ - {% for timestamp, num in jenkins.nonpassing %} - { - t: new Date({{ timestamp }} * 1000), - y: {{ num }} - }, - {% endfor %} - ] - }, - { - label: 'Total Jobs', - backgroundColor: "#003A72", - //borderColor: "#003A72", - data: [ - {% for timestamp, num in jenkins.total %} - { - t: new Date({{ timestamp }} * 1000), - y: {{ num }} - }, - {% endfor %} - ] - }, - ] - }, - options: { - scales: { - xAxes: [{ - type: 'time', - time: { - unit: 'day' + datasets: [ + { + label: 'Failing Jobs', + backgroundColor: "#FF0000", + //borderColor: "#FF0000", + data: [ + {% for timestamp, num in jenkins.failing %} + { + t: new Date({{ timestamp }} * 1000), + y: {{ num }} + }, + {% endfor %} + ] + }, + { + label: 'Non-passing Jobs', + backgroundColor: "#FFFF00", + //borderColor: "#FFFF00", + data: [ + {% for timestamp, num in jenkins.nonpassing %} + { + t: new Date({{ timestamp }} * 1000), + y: {{ num }} + }, + {% endfor %} + ] + }, + { + label: 'Total Jobs', + backgroundColor: "#003A72", + //borderColor: "#003A72", + data: [ + {% for timestamp, num in jenkins.total %} + { + t: new Date({{ timestamp }} * 1000), + y: {{ num }} + }, + {% endfor %} + ] + }, + ] + }, + options: { + scales: { + xAxes: [{ + type: 'time', + time: { + unit: 'day' + } + }] } - }] } - } });