Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dccXMLJSONConv
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DigitalDynamicMeasurement
dccXMLJSONConv
Commits
7af3ce64
Commit
7af3ce64
authored
5 months ago
by
Benedikt
Browse files
Options
Downloads
Patches
Plain Diff
fixed type hints for python 3.9
parent
a9370aee
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#50677
failed
5 months ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dccXMLJSONConv/dccConv.py
+4
-3
4 additions, 3 deletions
src/dccXMLJSONConv/dccConv.py
with
4 additions
and
3 deletions
src/dccXMLJSONConv/dccConv.py
+
4
−
3
View file @
7af3ce64
...
@@ -7,7 +7,8 @@ import re
...
@@ -7,7 +7,8 @@ import re
from
functools
import
reduce
from
functools
import
reduce
import
operator
import
operator
from
importlib
import
resources
as
imp_resources
from
importlib
import
resources
as
imp_resources
from
importlib.resources
import
files
from
importlib.resources
import
files
# Python 3.9+
import
warnings
import
warnings
from
typing
import
Union
#for python 3.8/3.9 compatibility
from
typing
import
Union
#for python 3.8/3.9 compatibility
...
@@ -28,7 +29,7 @@ def strip_outer_xml_tag(xml_str: str, outer_tag: str) -> str:
...
@@ -28,7 +29,7 @@ def strip_outer_xml_tag(xml_str: str, outer_tag: str) -> str:
return
xml_str
return
xml_str
def
get_from_dict
(
data_dict
:
dict
,
map_list
:
list
[
int
|
str
]):
def
get_from_dict
(
data_dict
:
dict
,
map_list
:
list
[
Union
[
int
,
str
]
]
):
"""
get entry from dict at specified location
"""
get entry from dict at specified location
Args:
Args:
...
@@ -41,7 +42,7 @@ def get_from_dict(data_dict: dict, map_list: list[int|str]):
...
@@ -41,7 +42,7 @@ def get_from_dict(data_dict: dict, map_list: list[int|str]):
return
reduce
(
operator
.
getitem
,
map_list
,
data_dict
)
return
reduce
(
operator
.
getitem
,
map_list
,
data_dict
)
def
set_in_dict
(
data_dict
:
dict
,
map_list
:
list
[
int
|
str
],
value
):
def
set_in_dict
(
data_dict
:
dict
,
map_list
:
list
[
Union
[
int
,
str
]
]
,
value
):
"""
insert value into dict
"""
insert value into dict
Args:
Args:
...
...
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