This repository has been archived by the owner on Jan 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allowing default flags in run_flow().
- Loading branch information
Showing
1 changed file
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dhermes
Author
Contributor
|
||
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 | ||
|
@@ -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 | ||
|
Documentation and examples, eg, https://cloud.google.com/bigquery/authentication, still refer to run not run_flow :(