Update count.py
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
parent
0b7f6502a9
commit
56626047c5
1 changed files with 5 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import pathlib
|
import pathlib
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
@ -12,6 +13,10 @@ from httplib2 import ServerNotFoundError
|
||||||
DIR = os.path.dirname(os.path.realpath(__file__))
|
DIR = os.path.dirname(os.path.realpath(__file__))
|
||||||
CREDENTIALS_PATH = os.path.join(DIR, 'credentials.json')
|
CREDENTIALS_PATH = os.path.join(DIR, 'credentials.json')
|
||||||
|
|
||||||
|
if not os.path.isfile(CREDENTIALS_PATH):
|
||||||
|
print(0)
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
gmail = discovery.build(
|
gmail = discovery.build(
|
||||||
'gmail', 'v1', credentials=file.Storage(CREDENTIALS_PATH).get())
|
'gmail', 'v1', credentials=file.Storage(CREDENTIALS_PATH).get())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue