Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vincent Wehrwein
website
Commits
f9f059d9
Commit
f9f059d9
authored
6 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
Correct time zone in ro-importer
parent
8767a8cf
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+3
-2
3 additions, 2 deletions
README.md
importer.py
+4
-2
4 additions, 2 deletions
importer.py
with
7 additions
and
4 deletions
README.md
+
3
−
2
View file @
f9f059d9
...
...
@@ -41,9 +41,10 @@ Notwendig:
*
git (zum Anzeigen der aktuellen Version)
Optional (wird für einzelne Features benötigt):
*
python-lxml (Campus Import)
*
python-lxml (Campus- und RO-Import)
*
python-pytz (RO-Import)
*
python-ldap (Login mit Fachschaftsaccount)
*
python-icalendar (
SoGo-
Kalenderimport für Sitzungsankündigungen)
*
python-icalendar (
RO-Import,
Kalenderimport für Sitzungsankündigungen)
*
python-mysql-connector (wenn MySQL als Datenbank verwendet werden soll)
*
python-coverage (Für Coverage Tests benötigt)
...
...
This diff is collapsed.
Click to expand it.
importer.py
+
4
−
2
View file @
f9f059d9
...
...
@@ -132,6 +132,8 @@ def fetch_ro_course_ical(id):
def
fetch_ro_course_events
(
item
):
import
icalendar
import
pytz
localtz
=
pytz
.
timezone
(
'
Europe/Berlin
'
)
# First fix crappy javascript fragment-Paths
url
=
urllib
.
parse
.
urlparse
(
item
[
'
url
'
].
replace
(
'
#/
'
,
''
))
args
=
urllib
.
parse
.
parse_qs
(
url
.
query
)
...
...
@@ -150,7 +152,7 @@ def fetch_ro_course_events(item):
continue
e
=
{}
e
[
'
place
'
]
=
str
(
comp
.
get
(
'
LOCATION
'
,
''
))
e
[
'
time
'
]
=
comp
[
'
DTSTART
'
].
dt
# TODO: tz
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
'
]
events
.
append
(
e
)
...
...
@@ -171,7 +173,7 @@ def import_from(id):
else
:
events
+=
fetch_ro_course_events
(
i
)
except
ImportError
:
flash
(
'
python-lxml not found, campus import will not work
.
'
)
flash
(
'
python-lxml
or python-pytz
not found, campus
and ro
import will not work
!
'
)
# events to add
newevents
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment