To set up Google Drive access, you need to jump through many hoops.
You need to have pydrive
and pycrypto
installed.
- Go to https://console.developers.google.com
- Set up a project. Give it whatever name you like.
- On the left side of the screen, click on "Dashboard"
- Click on "Enable APIs"
- Find "Google Drive API", click on it, and click on "Enable"
- On the same page, click on "Credentials" on the left.
- Click "Create credentials" and select "OAuth client ID" from the drop-down menu
- For "Application Type," choose "Other"
- Give it whatever name you want
- Click "Create"
- On the next page, a message box will show you the Oauth ID and secrets. Dismiss the box.
- On this page, download the client secrets file for the new Oauth client. (Right side of the screen). Save that to your ~/.config/cottoncandy/ folder with a name.
- Edit your ~/.config/cottoncandy/options.cfg file and edit the "client_secrets" field to the name of the file you just downloaded.
- In python, do
cc.get_interface(backed = 'gdrive')
- When prompted, say yes to opening a local browser.
- On the browser screen, choose your account, and allow access.
- Once the page says something like "Authorization complete," you can close it and go back to python.
- The cottoncandy object should be good to go.