Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: client/third_party/oauth2client/tools.py

Issue 1768993002: Update oauth2client to v2.0.1 and googleapiclient to v1.5.0. Base URL: git@github.com:luci/luci-py.git@master
Patch Set: . Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: client/third_party/oauth2client/tools.py
diff --git a/client/third_party/oauth2client/tools.py b/client/third_party/oauth2client/tools.py
index 629866b1641719ff836a4c8fb52f5d0c09100e0b..0ba8449d23e8f06b06f9c549639f577912ca43fe 100644
--- a/client/third_party/oauth2client/tools.py
+++ b/client/third_party/oauth2client/tools.py
@@ -26,6 +26,7 @@ import socket
import sys
from six.moves import BaseHTTPServer
+from six.moves import http_client
from six.moves import urllib
from six.moves import input
@@ -95,7 +96,7 @@ class ClientRedirectHandler(BaseHTTPServer.BaseHTTPRequestHandler):
if the flow has completed. Note that we can't detect
if an error occurred.
"""
- self.send_response(200)
+ self.send_response(http_client.OK)
self.send_header("Content-type", "text/html")
self.end_headers()
query = self.path.split('?', 1)[-1]
@@ -112,7 +113,7 @@ class ClientRedirectHandler(BaseHTTPServer.BaseHTTPRequestHandler):
@util.positional(3)
-def run_flow(flow, storage, flags, http=None):
+def run_flow(flow, storage, flags=None, http=None):
"""Core code for a command-line application.
The ``run()`` function is called from your application and runs
@@ -153,15 +154,18 @@ def run_flow(flow, storage, flags, http=None):
Args:
flow: Flow, an OAuth 2.0 Flow to step through.
storage: Storage, a ``Storage`` to store the credential in.
- flags: ``argparse.Namespace``, The command-line flags. This is the
- object returned from calling ``parse_args()`` on
- ``argparse.ArgumentParser`` as described above.
+ flags: ``argparse.Namespace``, (Optional) The command-line flags. This
+ is the object returned from calling ``parse_args()`` on
+ ``argparse.ArgumentParser`` as described above. Defaults
+ to ``argparser.parse_args()``.
http: An instance of ``httplib2.Http.request`` or something that
acts like it.
Returns:
Credentials, the obtained credential.
"""
+ if flags is None:
+ flags = argparser.parse_args()
logging.getLogger().setLevel(getattr(logging, flags.logging_level))
if not flags.noauth_local_webserver:
success = False

Powered by Google App Engine
This is Rietveld 408576698