Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #426 from dhermes/run-with-360
Browse files Browse the repository at this point in the history
Allowing default flags in run_flow().
  • Loading branch information
dhermes committed Feb 20, 2016
2 parents d5f4139 + 98df500 commit 1f18216
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions oauth2client/tools.py
Expand Up @@ -113,7 +113,7 @@ def log_message(self, format, *args):


@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
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 1f18216

Please sign in to comment.