Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Roman Karwacik
website
Commits
efdac5b6
Unverified
Commit
efdac5b6
authored
Aug 02, 2019
by
Andreas Valder
Browse files
fix some linter errors
parent
eac90506
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
efdac5b6
...
...
@@ -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=1
4
0 --output-format=text *.py | tee pylint.txt
-
pylint3 --indent-string='\t' --indent-after-paren=1 --max-line-length=1
6
0 --output-format=text *.py | tee pylint.txt
artifacts
:
paths
:
-
pylint.txt
...
...
chapters.py
View file @
efdac5b6
...
...
@@ -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'
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment