Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ test:
pytest $(ARGS)

init-virtual-env:
./init-virtual-env.sh
./scripts/venv/init.sh

google-auth:
python3 google_auth.py
python3 ./scripts/google/authenticate.py

clean:
rm -rf build .pytest_cache dist google_drive.egg-info

release:
./scripts/release.sh
./scripts/release/release.sh
2 changes: 1 addition & 1 deletion google-apis-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Authentication

We should have a credentials.json file to use for the authentication process.
We should have a `credentials.json` file to use for the authentication process.
You could obtain your credentials using [google developer console](https://console.developers.google.com/apis/)

Using the same credentials you could specify all scopes you need, e.g:
Expand Down
6 changes: 0 additions & 6 deletions init-virtual-env.sh

This file was deleted.

9 changes: 3 additions & 6 deletions google_auth.py → scripts/google/authenticate.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
from __future__ import print_function
from googledrive.api import GoogleAuth

from googledrive import api


# If modifying these scopes, delete the file token.pickle.
SCOPES = [
# drive: Full, permissive scope to access all of a user's files,
# excluding the Application Data folder.
"https://www.googleapis.com/auth/drive",
# gmail: Send messages only. No read or modify privileges on mailbox.
"https://www.googleapis.com/auth/gmail.send",
# docs: Per-file access to files that the app created or opened.
"https://www.googleapis.com/auth/drive.file",
# sheets:
# Allows read-only access to the user's sheets and their properties.
"https://www.googleapis.com/auth/spreadsheets.readonly",
# appscripts:
#'https://www.googleapis.com/auth/script.projects',
]

CREDENTIALS = "credentials.json"


def main():
GoogleAuth().authenticate(CREDENTIALS, SCOPES)
api.GoogleAuth().authenticate(CREDENTIALS, SCOPES)
print('File "token.pickle" should be generated')


Expand Down
File renamed without changes.
File renamed without changes.