Event file upload to Dropbox

Christopher Stawarz's Avatar

Christopher Stawarz

03 Jan, 2020 08:13 PM

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

  1. 1 Posted by mil on 06 Jan, 2020 03:21 PM

    mil's Avatar

    This looks great. Thank you Chris!
    Michael

  2. Christopher Stawarz closed this discussion on 10 Jan, 2020 04:44 PM.

  3. mil re-opened this discussion on 28 Jun, 2020 09:27 PM

  4. 2 Posted by mil on 28 Jun, 2020 09:27 PM

    mil's Avatar

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

  5. Support Staff 3 Posted by Christopher Sta... on 29 Jun, 2020 05:43 PM

    Christopher Stawarz's Avatar

    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

  6. Christopher Stawarz closed this discussion on 06 Jul, 2020 02:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac