CONABIO / antares3

Madmex with open data cube and in python3
2 stars 2 forks source link

Download order needs to receive an argument to set destination path #28

Open palmoreck opened 6 years ago

palmoreck commented 6 years ago

antares download_order command downloads apparently all orders with column value "downloaded=false" in table madmex_order of database without checking credentials in .antares file.

Also the files are downloaded to ~ directory of user.

Adapt this command to address this cases

loicdtx commented 6 years ago

1 - Even better if there's an option to send the downloaded files directly to a bucket (maybe by downloading as in-memory file object, and writing to bucket using boto3.Client.upload_fileobj())

2 - Right now files are downloaded to the global variable TEMP_DIR, which needs to be set in .antares. This is not the preferred way to handle temp dirs in UNIX. See gettempdir. Most uses of TEMP_DIR can probably be replaced by gettempdir(), and the .antares entry removed.

palmoreck commented 6 years ago
  1. Q: if TEMP_DIR it's not set then files will be downloaded to ~? because there's no TEMP_DIR variable in .antares of nodo5's container
loicdtx commented 6 years ago

That's right, default value (when not set in .antares) is defined in settings.py