Skip to content

Commit

Permalink
Merge pull request google#11 from tseaver/scrub-non_optional-gflags
Browse files Browse the repository at this point in the history
Really make 'gflags' optional.
  • Loading branch information
craigcitro committed Nov 19, 2014
2 parents 3a7c440 + 9be5156 commit e5a5c36
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apitools/base/py/credentials_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
import oauth2client.multistore_file
import oauth2client.tools

import gflags as flags
try:
from gflags import FLAGS
except ImportError:
FLAGS = None

import logging

from apitools.base.py import exceptions
Expand Down Expand Up @@ -192,8 +196,8 @@ def CredentialsFromFile(path, client_info):
client_info['client_id'],
client_info['user_agent'],
client_info['scope'])
if hasattr(flags.FLAGS, 'auth_local_webserver'):
flags.FLAGS.auth_local_webserver = False
if hasattr(FLAGS, 'auth_local_webserver'):
FLAGS.auth_local_webserver = False
credentials = credential_store.get()
if credentials is None or credentials.invalid:
print 'Generating new OAuth credentials ...'
Expand Down

0 comments on commit e5a5c36

Please sign in to comment.