summaryrefslogtreecommitdiffstats
path: root/dashboard/src/booking/stats.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2018-11-20 11:19:55 -0500
committerParker Berberian <pberberian@iol.unh.edu>2018-11-26 14:07:15 -0500
commitf2bbdbbf7e03be031723a9680aa9deaf80e4a99c (patch)
tree54086b0ae60b65da0905e3b51c922934247b5370 /dashboard/src/booking/stats.py
parent674812a20f6804c287e1355ec8a1adf907798a94 (diff)
Fix all flake8 errors
The flake8 command in test.sh finds no longer finds any errors. This may form a basis of a jenkins verify job as a sort of 'weak compile-time checks' The flake8 command will not complain about line length, and will not complain about django's manage.py file Change-Id: Ic47cb4fc7ada55e64485661ab6881aef475018ff Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'dashboard/src/booking/stats.py')
-rw-r--r--dashboard/src/booking/stats.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/dashboard/src/booking/stats.py b/dashboard/src/booking/stats.py
index 31f7ef1..b706577 100644
--- a/dashboard/src/booking/stats.py
+++ b/dashboard/src/booking/stats.py
@@ -19,9 +19,11 @@ class StatisticsManager(object):
Will return a dictionary of names and 2-D array of x and y data points.
e.g. {"plot1": [["x1", "x2", "x3"],["y1", "y2", "y3]]}
x values will be dates in string
- every change (booking start / end) will be reflected, instead of one data point per day
- y values are the integer number of bookings/users active at some point in the given date
- span is the number of days to plot. The last x value will always be the current time
+ every change (booking start / end) will be reflected,
+ instead of one data point per day
+ y values are the integer number of bookings/users active at
+ some point in the given date span is the number of days to plot.
+ The last x value will always be the current time
"""
x_set = set()
x = []
@@ -29,7 +31,7 @@ class StatisticsManager(object):
users = []
now = datetime.datetime.now(pytz.utc)
delta = datetime.timedelta(days=span)
- end = now-delta
+ end = now - delta
bookings = Booking.objects.filter(start__lte=now, end__gte=end)
for booking in bookings:
x_set.add(booking.start)