Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
Found this content helpful? Log in or sign up to leave a like!
Hello,
Does anybody know how to set up a custom location for the files downloaded by the dap? Basically need to setup the temporary folder in a much larger drive, instead of the dap using the windows default temp folder for each user. I'd like to change this just for the dap instead of changing the default in windows for the least minimal change.
I did find an old post about someone asking about setting this value, which was over a year ago, it was determined that this value needed to be set dap.api.DEFAULT_FOLDER. I'm not sure if this is still accurate in the latest version of the DAP since the apy.py doesnt have this variable anywhere.
The closest thing i found on the api.py is output_directory
Solved! Go to Solution.
Thanks for the replies. Looks like just setting the Temp via python os.environ would be the best approach.
I use Linux and declared an export on my environment on ~/.bash_profile :
declare -x TMPDIR="/my/new/temp/location"
One of the suggestions I made a while back was to include this as a "switch" on the dap client for this rather than using TEMPDIR from the global settings
Currently if you're using snapshot or incremental with the dap cli, you can specify --output-directory for snapshot or incremental (e.g
dap snapshot --namespace canvas --table accounts --output-directory $DEFAULT_DOWNLOAD_DIR
)
But I just tested with syncdb and no dice (dap: error: unrecognized arguments: --output-directory $DEFAULT_DOWNLOAD_DIR), but yeah I think @reynlds is right-on and aiofiles.tempfile.TemporaryDirectory will use $TMPDIR as its root dir just like regular tempfile will.
Yeah I've tried these params too, but I think these were in the older versions of the dap and was taken out in the newer versions. The windows equivalent of changing temp is a bit more disruptive in windows than it is in linux unfortunately, chaging default temp in environment is a bit too much.
Thanks for the replies. Looks like just setting the Temp via python os.environ would be the best approach.
We have a specific part for this problem in our documentation: https://developerdocs.instructure.com/services/dap/dap-cli-readme/dap-cli-getting-started#changing-t...
Here is the example from there:
dap syncdb --temp-dir /new/temp/location --connection-string postgresql://user:password@localhost/mydb --namespace canvas --table accounts
But this is only interesting if you are syncing to a database.
If you are just doing snapshot or incremental, that just downloads the files without pushing them into a database you can use the
--output-directory <string> (default: downloads)
flag.
this would be great on the CLI, but i dont see the dap on the python module accepting these params, would you have any details on passing that using the python dap?
Regarding the Lib you have figured it out the solution already, there is no other specific solution for that.
To participate in the Instructure Community, you need to sign up or log in:
Sign In