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
899b7632
Commit
899b7632
authored
Nov 12, 2018
by
Julian Rother
Browse files
Correct place names in ro-import
parent
f9f059d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
importer.py
View file @
899b7632
...
...
@@ -151,7 +151,16 @@ def fetch_ro_course_events(item):
if
comp
.
get
(
'STATUS'
)
!=
'CONFIRMED'
:
continue
e
=
{}
e
[
'place'
]
=
str
(
comp
.
get
(
'LOCATION'
,
''
))
place
=
str
(
comp
.
get
(
'LOCATION'
,
''
))
if
place
:
campus_room
=
place
.
split
(
'('
)[
-
1
].
split
(
')'
)[
0
]
dbplace
=
query
(
'SELECT name FROM places WHERE campus_room = ?'
,
campus_room
)
if
dbplace
:
e
[
'place'
]
=
dbplace
[
0
][
'name'
]
else
:
e
[
'place'
]
=
'Unbekannter Ort ('
+
place
+
')'
else
:
e
[
'place'
]
=
''
e
[
'time'
]
=
comp
[
'DTSTART'
].
dt
.
astimezone
(
localtz
).
replace
(
tzinfo
=
None
)
e
[
'duration'
]
=
int
((
comp
[
'DTEND'
].
dt
-
comp
[
'DTSTART'
].
dt
).
seconds
/
60
)
e
[
'title'
]
=
item
[
'type'
]
...
...
Write
Preview
Supports
Markdown
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