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
Show more breadcrumbs
dbnomics-fetchers
eurostat-fetcher
Commits
3ecf7544
Commit
3ecf7544
authored
2 years ago
by
Christophe Benz
Browse files
Options
Downloads
Patches
Plain Diff
Allow specifying the datasets to download
parent
bc1fc3f2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
download.py
+9
-4
9 additions, 4 deletions
download.py
with
9 additions
and
4 deletions
download.py
+
9
−
4
View file @
3ecf7544
...
...
@@ -71,9 +71,8 @@ def main():
parser
.
add_argument
(
"
--resume
"
,
action
=
"
store_true
"
,
help
=
"
keep existing files in target directory
"
)
parser
.
add_argument
(
"
--datasets
"
,
nargs
=
"
+
"
,
metavar
=
"
DATASET_CODE
"
,
help
=
"
download only the given datasets (datasets codes, space separated)
"
,
default
=
os
.
getenv
(
"
DATASETS
"
),
help
=
"
download only the given datasets (datasets codes, comma separated)
"
,
)
args
=
parser
.
parse_args
()
...
...
@@ -88,13 +87,19 @@ def main():
log
.
info
(
"
Command-line arguments: %r
"
,
args
)
if
args
.
from_datetime
is
None
:
log
.
info
(
"
Argument --from-datetime was not provided: all datasets will be downloaded
"
)
log
.
info
(
"
Argument --from-datetime was not provided:
"
"
the requested datasets will be downloaded without taking their update date into account
"
)
else
:
log
.
info
(
"
Argument --from-datetime=%r: only datasets that changed since that datetime will be downloaded
"
,
args
.
from_datetime
.
isoformat
(),
)
if
args
.
datasets
is
not
None
:
args
.
datasets
=
args
.
datasets
.
split
(
"
,
"
)
toc_file_name
=
"
table_of_contents.xml
"
toc_file
=
args
.
target_dir
/
toc_file_name
if
args
.
resume
and
toc_file
.
is_file
():
...
...
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