Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
metadata-and-data
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
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
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
indexers
metadata-and-data
Commits
4095c5eb
Commit
4095c5eb
authored
3 years ago
by
DESPRES Damien
Browse files
Options
Downloads
Patches
Plain Diff
fix #14076
parent
880ee41c
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!26
fix #14076
Pipeline
#34132
passed
2 years ago
Stage: sonar-analysis
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/fix_links.py
+7
-4
7 additions, 4 deletions
lib/fix_links.py
workers/metadata_processor.py
+1
-1
1 addition, 1 deletion
workers/metadata_processor.py
with
8 additions
and
5 deletions
lib/fix_links.py
+
7
−
4
View file @
4095c5eb
...
@@ -29,7 +29,7 @@ def translate_content_type( content_type ):
...
@@ -29,7 +29,7 @@ def translate_content_type( content_type ):
return
output
return
output
def
protocol_to_formats_and_services
(
links
):
def
protocol_to_formats_and_services
(
links
,
inRecord
):
output
=
links
.
copy
()
output
=
links
.
copy
()
...
@@ -47,6 +47,9 @@ def protocol_to_formats_and_services( links ):
...
@@ -47,6 +47,9 @@ def protocol_to_formats_and_services( links ):
elif
link
[
'
protocol
'
]
==
'
KML
'
:
elif
link
[
'
protocol
'
]
==
'
KML
'
:
output
[
k
][
'
formats
'
]
=
[
'
KML
'
]
output
[
k
][
'
formats
'
]
=
[
'
KML
'
]
output
[
k
][
'
service
'
]
=
'
KML
'
output
[
k
][
'
service
'
]
=
'
KML
'
elif
link
[
'
protocol
'
]
==
'
WS
'
and
inRecord
[
'
type
'
]
==
'
nonGeographicDataset
'
:
output
[
k
][
'
formats
'
]
=
[
'
JSON
'
,
'
CSV
'
]
output
[
k
][
'
service
'
]
=
'
WS
'
elif
link
[
'
protocol
'
]
==
'
WS
'
:
elif
link
[
'
protocol
'
]
==
'
WS
'
:
output
[
k
][
'
formats
'
]
=
[
'
JSON
'
,
'
ShapeFile
'
,
'
CSV
'
]
output
[
k
][
'
formats
'
]
=
[
'
JSON
'
,
'
ShapeFile
'
,
'
CSV
'
]
output
[
k
][
'
service
'
]
=
'
WS
'
output
[
k
][
'
service
'
]
=
'
WS
'
...
@@ -67,7 +70,7 @@ def protocol_to_formats_and_services( links ):
...
@@ -67,7 +70,7 @@ def protocol_to_formats_and_services( links ):
return
output
return
output
def
fix_links
(
links
,
credentials
=
None
):
def
fix_links
(
links
,
inRecord
,
credentials
=
None
):
fixed_links
=
links
.
copy
()
fixed_links
=
links
.
copy
()
...
@@ -180,7 +183,7 @@ def fix_links( links, credentials=None ):
...
@@ -180,7 +183,7 @@ def fix_links( links, credentials=None ):
fixed_links
[
k
][
'
url
'
]
=
link
[
'
url
'
].
split
(
'
?
'
)[
0
]
fixed_links
[
k
][
'
url
'
]
=
link
[
'
url
'
].
split
(
'
?
'
)[
0
]
return
protocol_to_formats_and_services
(
fixed_links
)
return
protocol_to_formats_and_services
(
fixed_links
,
inRecord
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
...
@@ -285,5 +288,5 @@ if __name__ == '__main__':
...
@@ -285,5 +288,5 @@ if __name__ == '__main__':
}
}
]
]
fixed_links
=
fix_links
(
links
)
fixed_links
=
fix_links
(
links
,{}
)
pprint
(
fixed_links
)
pprint
(
fixed_links
)
This diff is collapsed.
Click to expand it.
workers/metadata_processor.py
+
1
−
1
View file @
4095c5eb
...
@@ -161,7 +161,7 @@ def process_record( in_record, working_directory, credentials ):
...
@@ -161,7 +161,7 @@ def process_record( in_record, working_directory, credentials ):
if
'
link
'
in
out_record
[
'
metadata-fr
'
].
keys
():
if
'
link
'
in
out_record
[
'
metadata-fr
'
].
keys
():
del
out_record
[
'
metadata-fr
'
][
'
link
'
]
del
out_record
[
'
metadata-fr
'
][
'
link
'
]
tmp
=
list_to_dictlist
(
in_record
[
'
link
'
],
'
link
'
)
#links
tmp
=
list_to_dictlist
(
in_record
[
'
link
'
],
'
link
'
)
#links
out_record
[
'
metadata-fr
'
][
'
link
'
]
=
enrich_links
(
fix_links
(
tmp
,
credentials
),
credentials
,
working_directory
)
out_record
[
'
metadata-fr
'
][
'
link
'
]
=
enrich_links
(
fix_links
(
tmp
,
in_record
,
credentials
),
credentials
,
working_directory
)
if
'
userinfo
'
in
out_record
[
'
metadata-fr
'
].
keys
():
if
'
userinfo
'
in
out_record
[
'
metadata-fr
'
].
keys
():
del
out_record
[
'
metadata-fr
'
][
'
userinfo
'
]
del
out_record
[
'
metadata-fr
'
][
'
userinfo
'
]
...
...
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