Commit 8f47ce02 authored by Andreas Valder's avatar Andreas Valder

fix some linter errors

parent 8f7ccbad
......@@ -7,7 +7,7 @@ linter:
- python3 -V
- uname -a
- apt install -y sqlite3 locales-all git python3-flask python3-ldap3 python3-requests python3-lxml python3-icalendar python3-mysql.connector python3-requests python3-coverage pylint3
- pylint3 --indent-string='\t' --indent-after-paren=1 --max-line-length=160 --docstring-min-length=9999 --output-format=text *.py | tee pylint.txt
- pylint3 --indent-string='\t' --indent-after-paren=1 --max-line-length=160 --disable=missing-docstring,unused-wildcard-import --output-format=text *.py | tee pylint.txt
artifacts:
paths:
- pylint.txt
......
......@@ -152,7 +152,7 @@ def sort_file(filename, course=None, lectures=None):
matches = filter_lectures_by_datetime(lectures, data.get('date'), data.get('time'))
# if we can't match exactly based on date and time, we have to match keywords
if ((len(matches) != 1) and (len(data['keywords']) > 0)):
if not len(matches) == 0:
if not matches:
# only test lectures with the correct date/time, if we have any
matches = filter_lectures_by_keywords(matches, data['keywords'])
else:
......
......@@ -12,12 +12,12 @@ def stats():
for s in semester:
year = int(s['semester'][0:4])
if s['semester'].endswith('ss'):
s['from'] = datetime(year,4,1)
s['to'] = datetime(year,10,1)
s['from'] = datetime(year, 4, 1)
s['to'] = datetime(year, 10, 1)
if s['semester'].endswith('ws'):
s['from'] = datetime(year,10,1)
s['to'] = datetime(year+1,4,1)
return render_template('stats.html',semester=semester,filter=request.args.get('filter'))
s['from'] = datetime(year, 10, 1)
s['to'] = datetime(year+1, 4, 1)
return render_template('stats.html', semester=semester, filter=request.args.get('filter'))
statsqueries = {}
statsqueries['formats_views'] = "SELECT formats.description AS labels, count(DISTINCT log.id) AS `values` FROM log JOIN videos ON (videos.id = log.video) JOIN formats ON (formats.id = videos.video_format) GROUP BY formats.id"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment