def retrieve_auth():
 def get_kwargs(envargs):
  return dict([(arg.kwarg, os.environ.get(arg.envarg)) for arg in envargs])
 mc_kwargs = get_kwargs(mc_envargs)
 mm_kwargs = get_kwargs(mm_envargs)
 if (not all([mc_kwargs[arg] for arg in (u'email', u'password', u'android_id')])):
  if os.environ.get(u'TRAVIS'):
   print(u'on Travis but could not read auth from environ; quitting.')
   sys.exit(1)
  mc_kwargs.update(zip([u'email', u'password', u'android_id'], prompt_for_mc_auth()))
 if (mm_kwargs[u'oauth_credentials'] is None):
  if (not os.path.isfile(OAUTH_FILEPATH)):
   raise ValueError(u'You must have oauth credentials stored at the default path by Musicmanager.perform_oauth prior to running.')
  del mm_kwargs[u'oauth_credentials']
 else:
  mm_kwargs[u'oauth_credentials'] = credentials_from_refresh_token(mm_kwargs[u'oauth_credentials'])
 return (mc_kwargs, mm_kwargs)

def retrieve_auth ( ) : def get_kwargs ( envargs ) : return dict ( [ ( arg . kwarg , os . environ . get ( arg . envarg ) ) for arg in envargs ] ) mc_kwargs = get_kwargs ( mc_envargs ) mm_kwargs = get_kwargs ( mm_envargs ) if ( not all ( [ mc_kwargs [ arg ] for arg in ( u'email' , u'password' , u'android_id' ) ] ) ) : if os . environ . get ( u'TRAVIS' ) : print ( u'on Travis but could not read auth from environ; quitting.' ) sys . exit ( 1 ) mc_kwargs . update ( zip ( [ u'email' , u'password' , u'android_id' ] , prompt_for_mc_auth ( ) ) ) if ( mm_kwargs [ u'oauth_credentials' ] is None ) : if ( not os . path . isfile ( OAUTH_FILEPATH ) ) : raise ValueError ( u'You must have oauth credentials stored at the default path by Musicmanager.perform_oauth prior to running.' ) del mm_kwargs [ u'oauth_credentials' ] else : mm_kwargs [ u'oauth_credentials' ] = credentials_from_refresh_token ( mm_kwargs [ u'oauth_credentials' ] ) return ( mc_kwargs , mm_kwargs )
searches the env for auth .