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": { "linters": {
"sample": { "python": {
"type": "flake8" "type": "flake8",
"exclude": "(\\.html$)"
} }
} }
} }

@ -117,19 +117,19 @@ if __name__ == "__main__":
# Parse CLI arguments # Parse CLI arguments
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--db-location", type=str, default=":memory:", 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", parser.add_argument("--log", type=str, default="WARNING",
help="Default logging level") help="Default logging level")
args = parser.parse_args() args = parser.parse_args()
# Ensure the logging level is set properly # Ensure the logging level is set properly
num_level = getattr(log, args.log.upper(), None) num_level = getattr(log, args.log.upper(), None)
if not isinstance(num_level, int): 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 # Fully configure the logger
log.basicConfig(format="%(asctime)s\t%(levelname)s\t%(message)s", 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 # Initialize a dict to store data for the summary page
summary_page = {} summary_page = {}

@ -188,7 +188,7 @@ class JenkinsModule:
# Write it back to the filename in the output dir # Write it back to the filename in the output dir
with open(path.join("output", "jenkins_%sdays.html" % days), with open(path.join("output", "jenkins_%sdays.html" % days),
"w+") as f: "w+") as f:
f.write(template) f.write(template)
# Return the averages for use in the summary # Return the averages for use in the summary

@ -5,15 +5,11 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <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"> <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> </head>
<body> <body>
<div class="container"> <div class="container">
<div class="row justify-content-center">
<div class="col">
</div>
</div>
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col" style="text-align: center;"> <div class="col" style="text-align: center;">
<h1>Summary for Lubuntu Project Metrics</h1> <h1>Summary for Lubuntu Project Metrics</h1>
@ -22,13 +18,13 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col" style="text-align: center;"> <div class="col" style="text-align: center;">
<h2>Jenkins Data</h2> <h2>Jenkins Data</h2>
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>Time (days)</th> <th>Time (days)</th>
<th>Average Failing</th> <th>Average Failing</th>
<th>Average Non-passing</th> <th>Average Non-passing</th>
<th>Average Total</th> <th>Average Total</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -37,9 +33,9 @@
<td>{{ day }}</td> <td>{{ day }}</td>
{% for avg in page.Jenkins[day] %} {% for avg in page.Jenkins[day] %}
<td>{{ avg }}</td> <td>{{ avg }}</td>
{% endfor %} {% endfor %}
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>

@ -8,15 +8,11 @@
<!-- Import Chart.js 2.9.3 --> <!-- Import Chart.js 2.9.3 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.bundle.js"></script> <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"> <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> </head>
<body> <body>
<div class="container"> <div class="container">
<div class="row justify-content-center">
<div class="col">
</div>
</div>
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col" style="text-align: center;"> <div class="col" style="text-align: center;">
<h1>Jenkins data for the past {{ days }} day(s)</h1> <h1>Jenkins data for the past {{ days }} day(s)</h1>
@ -34,58 +30,58 @@
var myChart = new Chart(ctx, { var myChart = new Chart(ctx, {
type: 'line', type: 'line',
data: { data: {
datasets: [ datasets: [
{ {
label: 'Failing Jobs', label: 'Failing Jobs',
backgroundColor: "#FF0000", backgroundColor: "#FF0000",
//borderColor: "#FF0000", //borderColor: "#FF0000",
data: [ data: [
{% for timestamp, num in jenkins.failing %} {% for timestamp, num in jenkins.failing %}
{ {
t: new Date({{ timestamp }} * 1000), t: new Date({{ timestamp }} * 1000),
y: {{ num }} y: {{ num }}
}, },
{% endfor %} {% endfor %}
] ]
}, },
{ {
label: 'Non-passing Jobs', label: 'Non-passing Jobs',
backgroundColor: "#FFFF00", backgroundColor: "#FFFF00",
//borderColor: "#FFFF00", //borderColor: "#FFFF00",
data: [ data: [
{% for timestamp, num in jenkins.nonpassing %} {% for timestamp, num in jenkins.nonpassing %}
{ {
t: new Date({{ timestamp }} * 1000), t: new Date({{ timestamp }} * 1000),
y: {{ num }} y: {{ num }}
}, },
{% endfor %} {% endfor %}
] ]
}, },
{ {
label: 'Total Jobs', label: 'Total Jobs',
backgroundColor: "#003A72", backgroundColor: "#003A72",
//borderColor: "#003A72", //borderColor: "#003A72",
data: [ data: [
{% for timestamp, num in jenkins.total %} {% for timestamp, num in jenkins.total %}
{ {
t: new Date({{ timestamp }} * 1000), t: new Date({{ timestamp }} * 1000),
y: {{ num }} y: {{ num }}
}, },
{% endfor %} {% endfor %}
] ]
}, },
] ]
}, },
options: { options: {
scales: { scales: {
xAxes: [{ xAxes: [{
type: 'time', type: 'time',
time: { time: {
unit: 'day' unit: 'day'
}
}]
} }
}]
} }
}
}); });
</script> </script>
</body> </body>

Loading…
Cancel
Save