fix some linter errors

parent eac90506
......@@ -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
......
......@@ -22,10 +22,10 @@ def import_xmp_chapters(jobid, jobtype, data, state, status):
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'})
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