diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ae485de80081d354f732975fb99d4307993592a..9c0a0896eb2b7acd5b6c8e78e12019c0b689c767 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=140 --output-format=text *.py | tee pylint.txt + - pylint3 --indent-string='\t' --indent-after-paren=1 --max-line-length=160 --output-format=text *.py | tee pylint.txt artifacts: paths: - pylint.txt diff --git a/chapters.py b/chapters.py index a0d35b2ea50b6974ec4e6187a89450b1b045a296..211e78b19266c26c215979e99ee77e9cf23e010f 100644 --- a/chapters.py +++ b/chapters.py @@ -15,17 +15,17 @@ def import_xmp_chapters(jobid, jobtype, data, state, status): if int(chapter['time']) in times: continue modify('INSERT INTO chapters (lecture_id, time, text, visible, time_created, time_updated) VALUES (?, ?, ?, 0, ?, ?)', - data['lecture_id'], int(chapter['time']), chapter['text'], - datetime.now(), datetime.now()) + data['lecture_id'], int(chapter['time']), chapter['text'], + datetime.now(), datetime.now()) @app.route('/internal/newchapter/<int:lectureid>', methods=['POST', 'GET']) def suggest_chapter(lectureid): time = request.values['time'] text = request.values['text'] - assert(time and text) + assert time and text try: - x = datetime.strptime(time,'%H:%M:%S') - time= timedelta(hours=x.hour,minutes=x.minute,seconds=x.second).total_seconds() + x = datetime.strptime(time, '%H:%M:%S') + time = timedelta(hours=x.hour, minutes=x.minute, seconds=x.second).total_seconds() time = int(time) except ValueError: if 'ref' in request.values: @@ -58,4 +58,4 @@ def chapters(lectureid): last = c if 'json' in request.values: return Response(json.dumps([{'time': c['time'], 'text': c['text']} for c in chapters]), mimetype='application/json') - return Response(render_template('chapters.srt',chapters=chapters), 200, {'Content-Type':'text/vtt'}) + return Response(render_template('chapters.srt', chapters=chapters), 200, {'Content-Type':'text/vtt'})