Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eurostat-fetcher
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
There was a problem fetching the pipeline stages.
Show more breadcrumbs
dbnomics-fetchers
eurostat-fetcher
Commits
8afd265f
Commit
8afd265f
authored
7 years ago
by
Christophe Benz
Browse files
Options
Downloads
Patches
Plain Diff
Do not pretty-print huge files
parent
898abf9a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1095
failed with stage
in 5 minutes and 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eurostat_bulk_fetcher.py
+3
-3
3 additions, 3 deletions
eurostat_bulk_fetcher.py
with
3 additions
and
3 deletions
eurostat_bulk_fetcher.py
+
3
−
3
View file @
8afd265f
...
...
@@ -176,7 +176,7 @@ def main():
for
metadata_zip_info
in
metadata_zip_file
.
infolist
():
if
metadata_zip_info
.
filename
.
endswith
(
'
.xml
'
):
with
metadata_zip_file
.
open
(
metadata_zip_info
)
as
metadata_file
:
xml_tree
=
etree
.
parse
(
metadata_file
,
parser
=
xml_parser
)
xml_tree
=
etree
.
parse
(
metadata_file
)
xml_file_path
=
os
.
path
.
join
(
metadata_dir
,
metadata_zip_info
.
filename
)
write_normalized_xml_element
(
xml_file_path
,
xml_tree
.
getroot
())
else
:
...
...
@@ -199,7 +199,7 @@ def main():
for
data_zip_info
in
data_zip_file
.
infolist
():
if
data_zip_info
.
filename
.
endswith
(
'
.xml
'
):
with
data_zip_file
.
open
(
data_zip_info
)
as
data_file
:
xml_tree
=
etree
.
parse
(
data_file
,
parser
=
xml_parser
)
xml_tree
=
etree
.
parse
(
data_file
)
xml_file_path
=
os
.
path
.
join
(
dataset_dir
,
data_zip_info
.
filename
)
write_normalized_xml_element
(
xml_file_path
,
xml_tree
.
getroot
())
else
:
...
...
@@ -251,7 +251,7 @@ def write_normalized_xml_element(xml_file_path, xml_element):
prepared_element
.
text
=
'
1111-11-11T11:11:11
'
with
open
(
xml_file_path
,
'
wb
'
)
as
xml_file
:
etree
.
ElementTree
(
xml_element
).
write
(
xml_file
,
encoding
=
'
utf-8
'
,
pretty_print
=
True
,
xml_declaration
=
True
)
etree
.
ElementTree
(
xml_element
).
write
(
xml_file
,
encoding
=
'
utf-8
'
,
xml_declaration
=
True
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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