diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b26e75b07d9c9cd1c8e9b92ee359550d21fd18e2..1ac5e81d05fa7d9f82db4b7c2e14dd23276f175e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/sorter.py b/sorter.py index 7d2f72c704c9f2303805a0a9a48a9804d1357f47..3da37e4f34bb3d9a208aa846e1478bc697a6289d 100644 --- a/sorter.py +++ b/sorter.py @@ -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: diff --git a/stats.py b/stats.py index 6e9df8ffb72378e48ee1d115d708ec1f76550f8b..cc19aae3db2d2e5341673ee779d5de1cca960019 100644 --- a/stats.py +++ b/stats.py @@ -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"