Delint everything, make tabs four spaces instead.

master
Simon Quigley 4 years ago
parent 5b4ed6ac5c
commit 5c486a878a

@ -1,8 +1,9 @@
{
"exclude": "(^LICENSE)",
"exclude": "(^LICENSE|.gitignore)",
"linters": {
"sample": {
"type": "flake8"
"python": {
"type": "flake8",
"exclude": "(\\.html$)"
}
}
}

@ -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 = {}

@ -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

@ -5,15 +5,11 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Import Bootstrap 4.3.1 -->
<!-- Import Bootstrap 4.3.1 -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col">
</div>
</div>
<div class="row justify-content-center">
<div class="col" style="text-align: center;">
<h1>Summary for Lubuntu Project Metrics</h1>
@ -22,13 +18,13 @@
<div class="row justify-content-center">
<div class="col" style="text-align: center;">
<h2>Jenkins Data</h2>
<table class="table table-striped">
<table class="table table-striped">
<thead>
<tr>
<th>Time (days)</th>
<th>Average Failing</th>
<th>Average Non-passing</th>
<th>Average Total</th>
<th>Average Failing</th>
<th>Average Non-passing</th>
<th>Average Total</th>
</tr>
</thead>
<tbody>
@ -37,9 +33,9 @@
<td>{{ day }}</td>
{% for avg in page.Jenkins[day] %}
<td>{{ avg }}</td>
{% endfor %}
{% endfor %}
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
</div>

@ -8,15 +8,11 @@
<!-- Import Chart.js 2.9.3 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.bundle.js"></script>
<!-- Import Bootstrap 4.3.1 -->
<!-- Import Bootstrap 4.3.1 -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col">
</div>
</div>
<div class="row justify-content-center">
<div class="col" style="text-align: center;">
<h1>Jenkins data for the past {{ days }} day(s)</h1>
@ -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'
}
}]
}
}]
}
}
});
</script>
</body>

Loading…
Cancel
Save