Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Commit

Permalink
Allowing default flags in run_flow().
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Feb 20, 2016
1 parent d5f4139 commit 98df500
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions oauth2client/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def log_message(self, format, *args):


@util.positional(3)
def run_flow(flow, storage, flags, http=None):

This comment has been minimized.

Copy link
@nad2000

nad2000 Feb 23, 2016

Documentation and examples, eg, https://cloud.google.com/bigquery/authentication, still refer to run not run_flow :(

This comment has been minimized.

Copy link
@dhermes

dhermes Feb 23, 2016

Author Contributor

Thanks for the pointer to the old docs. Filed #435. We can discuss there.

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
Expand Down Expand Up @@ -154,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
Expand Down

0 comments on commit 98df500

Please sign in to comment.