Event file upload to Dropbox

Hi Michael,

I’ve attached an example experiment that demonstrates how to upload MWorks event files stored on an iPad to Dropbox. (It should work on a Mac, too, although I haven’t tested it and don’t know why you’d need it there.)

The Python function upload_event_files finds all MWK2 files in MWorks’ data directory, uploads each file to Dropbox, and deletes the local copy of the file upon successful completion of the upload. It won’t upload the currently-open event file. (You could alter it to do so, although you’d have to be sure to replace, not append to, any earlier copy of the same file on Dropbox.)

My idea is that this could be run first thing every session, to upload previous sessions’ event files. Obviously, you can arrange things however you like.

If you have any questions or run in to any issues, please let me know.

Cheers,
Chris

Attachment: event_file_upload.zip (2.53 KB)

This looks great. Thank you Chris!
Michael

Just to follow up on this — how should we install the python Dropbox module on the iPads?
event_file_upload.py runs “import dropbox”.

From the README:

To install local copies of the Dropbox Python SDK and dependencies:

    pip3 install -t python dropbox setuptools

This will create a directory called “python” next to the experiment file. The experiment declares this directory as a resource, so it will be copied to the server when the experiment loads.

Chris