We're working on a brand new Dropbox Wiki with better features and ease of access! Find out more.
From Dropbox Wiki
Improved Python script to get dropbox config values
Works for both dropbox 0.7.x, 0.8.x and 1.0.x and on all platforms (Windows / Mac / Linux)
Download here: http://dl.dropbox.com/u/340607/pyDropboxValues.py
For Python < 2.6 Users: http://pastebin.com/eKymSQ1w
Place pyDropboxValues.py somewhere on your $PATH, make it executable, and then run it in a terminal / DOS window.
It will print a big list of all the config keys, and their values.
Extra Features :-D
- Get the value for just one config key, e.g.
- Print out all available config keys (the little u at the front of each just means they're Unicode strings - you can simply ignore it)
- Print the location of the user's Dropbox folder (not always stored in the config database)
- Print a URL suitable for use in Text_Based_Linux_Install
- Backup your config database (so you can restore it, if you accidentally break it)
- Display the 'raw' undecoded values
- Display the 'special' options accepted by this command
- If you want, you can do
from pyDropboxValues import *
in your own Python script, and then you have access to the functions GetConfigDbDirectory, GetConfigDbFilename, GetDbConnection, GetDbVersion, GetDbKeys, ReadDbValue, WriteDbValue, DeleteDbValue, & GetDropboxLocation (hopefully the usage is fairly straightforward, see Switch_Proxy_Settings for an example) - I'm not sure of the re-use licence of my code because it borrows so much from the two scripts mentioned below, and neither of those specify a licence.
SyntaxError: invalid syntax
If you are using Python 2.5 or earlier maybe you will get this error.
File "./pyDropboxValues.py", line 213 except Exception as detail: ^ SyntaxError: invalid syntax
For fix this you must upgrade your python version to 2.6 or greater (or see the link near the top of this page).
As a developer and tinkerer I really liked the functionality provided by Python_Script_To_Display_Config but unfortunately it doesn't work once you've upgraded your dropbox client to the 0.8.x builds... I'd also seen some people say that it sometimes didn't work properly on Linux.
Like pyDropboxPath, it seamlessly works on all operating systems and with all dropbox versions; and like Python_Script_To_Display_Config it simply prints out all the configuration values stored in the dropbox config database.