Skip to content

Obtaining Credentials Vs Using Credentials --- Separate Them For Clarity's Sake #328

Description

@mohsenBanan

Summary

To the extent that this is sample code, clarity should be considered integral and fundamental.

Lack of clarity is an "issue". This "issue" applies to most google quickstart.py. All of those can benefit from this.

main() is doing two things:

  1. obtains the credentials
  2. uses the credentials to do some thing

So, on top of main() create a function called: obtain_credentials(scopes).
It would return creds.

main() would then first do
creds = obtain_credentials(scopes)
and then comes the service usage part.

This way, the whole thing is a lot more clear and less duplicated (across all quickstart.py-s)

Expected Behavior

See above.

Actual Behavior

See Above.

Steps to Reproduce the Problem

See Above.

Specifications

  • Python version (python --version) = ALL
  • OS (Mac/Linux/Windows) = ALL

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions