Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Using the Dropbox Module
-
@wrenoud Any chance you will update your script to also support the entire folder? I can't figure out what lines to change to not download my entire Dropbox first.
-
I've added editor.reload_files() to the script because when it creates files in pythonista my list qas not being updated unless I've ordered again or closed and opened the app.
-
I'm trying to run the script dropboxlogin - after creating the Dropbox app, getting the key and secret, setting these in the script and the access type to 'dropbox' - but when I run the script I get the error
"Invalid key (.......). Check your app's configuration to make sure everything. Is correct".
In this message the key string is correct. I am sure I am missing something but help would be appreciated. -
@johnbenallen Make sure that the app you've configured on the Dropbox developer page is also set to "full access" (and not app folder), that's the only thing I can think of right now.
-
On the App Info page it says that access type is "Full Dropbox'", so should be ok.
Another thought: when I created the app I took the option "core API". Should I have selected "sync API"? This choice is not visible in the App Info page.
-
No, core API is right, not sure what else could have gone wrong, if you're certain that you copied the key and secret strings correctly.
-
Thanks for the script, it works fine. The only annoying thing was that it syncs everything, including .git/ folders and the like.
This is my solution to exclude a folder from syncing:
- move the .git folder out of the Dropbox sync folder
- create an empty .git folder in the old location
- uncheck this empty folder in the selective sync list in the Dropbox preferences. It will be deleted locally (that's why we moved it in step 1)
- move back the folder to it's previous location. Dropbox will now ignore it.
-
This worked perfectly. Thanks!!!
-
Thank you so much!
-
I am encountering a problem with wrenoud's otherwise excellent DropboxSync.py GIST with the latest Pythonista and the Inbox directory.
If the Inbox directory is empty, sync works perfectly. If there are files in Inbox, while upload to dropbox works fine, when I come to sync these to a different I-device, DropboxSync.py crashes with the following error when it attempts to download the Inbox file to this second device.
The error occurs on line 61 of the script when Pythonista is trying to open up a non-existent file in Inbox for writing to. The error message is:
IOError: [Errno 1] Operation not permitted: u'Inbox/filename.py'
Sync with other sub folders works perfectly.
Do any of you have an idea for how to fix this? Does the Inbox folder have special permissions? Is there an updated version of wrenoud's script which works better with Inbox?
Thanks (I'm a python newbie and fixing this seems beyond my current powers!)
Update: After some further experimentation I am coming to the conclusion that scripts are simply not allowed write access to the Inbox folder. Is this the case?
-
I seem unable to give scripts write access to Inbox, but have come up with a workaround. I have now added the conditional to the download function in the script:
if not head=='Inbox':
which ignores the Inbox directory and hence does not sync it.
Once I have got GIST and GitHub up and running I'll upload this as a fork.
Edit: Here is the forked version with this work around included. DropboxSync now works in 1.4 without crashing but does not sync files in Inbox directory.
-
-
Luk,
That sounds super cool. Checking out your script as soon as I can!
-
@sidewinder: I think your conclusion is correct. Since the Inbox folder is not generated in the same way as other folders, my guess is that it is read-only to scripts, though I may be wrong.
-
Thanks Coder123! It is strange, the console seems to have permissions to delete scripts in that directory, but not write to it! In any case, the fix above does work now, but it is making me cringe a little. Now I have learnt more Python, a far better way of accomplishing the error handling would be to use try and except.
-
A nasty bug in DropboxSync deletes files with unicode characters in their filename. :-(
-
I've tried the dropboxlogin.py script, il works perfectly with Python 2.7 but not under 3.5's version (even when the print function is updated to the parenthesized form).
Is there a "3.5's" script version available somewhere or is there one planed ? -
@bistrot Add the
#! python2
she-bang at the top of the script to tell it to use the (possibly) nom-default python 2.7 interpreter. -
@bistrot This isn't intended to be a script that's actively maintained in the long-term. You're welcome to update it yourself if you'd like, though.
-
btw, iirc this script used api v1, which goes away in about 1year.