Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Untis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Untis
Commits
0c78a36b
Unverified
Commit
0c78a36b
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Add type hints. Advances BiscuIT-ng#20.
parent
50638fe2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
biscuit/apps/untis/util.py
+6
-4
6 additions, 4 deletions
biscuit/apps/untis/util.py
biscuit/apps/untis/views.py
+2
-1
2 additions, 1 deletion
biscuit/apps/untis/views.py
with
8 additions
and
5 deletions
biscuit/apps/untis/util.py
+
6
−
4
View file @
0c78a36b
from
datetime
import
date
,
time
from
xml.dom
import
minidom
from
typing
import
ByteIO
,
Optional
from
xml.dom
import
minidom
,
Node
from
django.http
import
HttpRequest
from
django.utils.translation
import
ugettext_lazy
as
_
from
biscuit.apps.chronos.models
import
Subject
,
TimePeriod
,
Room
,
Lesson
...
...
@@ -8,7 +10,7 @@ from biscuit.core.models import Group, Person
from
biscuit.core.util
import
messages
def
get_child_node_text
(
node
,
tag
)
:
def
get_child_node_text
(
node
:
Node
,
tag
:
str
)
->
Optional
[
str
]
:
tag_nodes
=
node
.
getElementsByTagName
(
tag
)
if
len
(
tag_nodes
)
==
1
:
...
...
@@ -17,7 +19,7 @@ def get_child_node_text(node, tag):
return
None
def
get_child_node_id
(
node
,
tag
)
:
def
get_child_node_id
(
node
:
Node
,
tag
:
str
)
->
Optional
[
str
]
:
tag_nodes
=
node
.
getElementsByTagName
(
tag
)
if
len
(
tag_nodes
)
==
1
:
...
...
@@ -26,7 +28,7 @@ def get_child_node_id(node, tag):
return
None
def
untis_import_xml
(
request
,
untis_xml
)
:
def
untis_import_xml
(
request
:
HttpRequest
,
untis_xml
:
Union
{
ByteIO
,
str
])
->
None
:
dom
=
minidom
.
parse
(
untis_xml
)
subjects
=
dom
.
getElementsByTagName
(
'
subject
'
)
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/untis/views.py
+
2
−
1
View file @
0c78a36b
from
django.contrib.auth.decorators
import
login_required
from
django.http
import
HttpRequest
,
HttpResponse
from
django.shortcuts
import
render
from
.forms
import
UntisUploadForm
...
...
@@ -9,7 +10,7 @@ from biscuit.core.decorators import admin_required
@login_required
@admin_required
def
untis_import
(
request
)
:
def
untis_import
(
request
:
HttpRequest
)
->
HttpResponse
:
context
=
{}
upload_form
=
UntisUploadForm
()
...
...
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