Line 0
Link Here
|
|
|
1 |
--- gcalcli.orig 2014-12-17 01:50:24 UTC |
2 |
+++ gcalcli |
3 |
@@ -185,7 +185,8 @@ try: |
4 |
from apiclient.discovery import build |
5 |
from oauth2client.file import Storage |
6 |
from oauth2client.client import OAuth2WebServerFlow |
7 |
- from oauth2client.tools import run |
8 |
+ from oauth2client.tools import run_flow |
9 |
+ from oauth2client.tools import argparser |
10 |
except ImportError as e: |
11 |
print "ERROR: Missing module - %s" % e.args[0] |
12 |
sys.exit(1) |
13 |
@@ -627,14 +628,15 @@ class gcalcli: |
14 |
credentials = storage.get() |
15 |
|
16 |
if credentials is None or credentials.invalid: |
17 |
- credentials = run( |
18 |
+ args, unknown = argparser.parse_known_args(sys.argv) |
19 |
+ credentials = run_flow( |
20 |
OAuth2WebServerFlow( |
21 |
client_id=self.client_id, |
22 |
client_secret=self.client_secret, |
23 |
scope=['https://www.googleapis.com/auth/calendar', |
24 |
'https://www.googleapis.com/auth/urlshortener'], |
25 |
user_agent=__program__+'/'+__version__), |
26 |
- storage) |
27 |
+ storage, args) |
28 |
|
29 |
self.authHttp = credentials.authorize(httplib2.Http()) |
30 |
|