Skip to content
Snippets Groups Projects
Commit 3ecf7544 authored by Christophe Benz's avatar Christophe Benz
Browse files

Allow specifying the datasets to download

parent bc1fc3f2
No related branches found
No related tags found
No related merge requests found
......@@ -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():
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment