Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
W
website
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
84
Issues
84
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Video AG Infrastruktur
website
Commits
f9f059d9
Commit
f9f059d9
authored
Nov 11, 2018
by
Julian Rother
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct time zone in ro-importer
parent
8767a8cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
README.md
README.md
+3
-2
importer.py
importer.py
+4
-2
No files found.
README.md
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)
...
...
importer.py
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
=
[]
...
...
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