def prompt_for_mc_auth():
 print(u'These tests will never delete or modify your music.\n\nIf the tests fail, you *might* end up with a test song/playlist in your library, though.\n')
 mclient = Mobileclient()
 valid_mc_auth = False
 while (not valid_mc_auth):
  print()
  email = input(u'Email: ')
  passwd = getpass()
  try:
   android_id = os.environ[u'GM_AA_D_ID']
  except KeyError:
   android_id = input(u"Device ID ('mac' for FROM_MAC_ADDRESS): ")
  if (android_id == u'mac'):
   android_id = Mobileclient.FROM_MAC_ADDRESS
  if (not android_id):
   print(u'a device id must be provided')
   sys.exit(1)
  valid_mc_auth = mclient.login(email, passwd, android_id)
 return (email, passwd, android_id)

def prompt_for_mc_auth ( ) : print ( u'These tests will never delete or modify your music.\n\nIf the tests fail, you *might* end up with a test song/playlist in your library, though.\n' ) mclient = Mobileclient ( ) valid_mc_auth = False while ( not valid_mc_auth ) : print ( ) email = input ( u'Email: ' ) passwd = getpass ( ) try : android_id = os . environ [ u'GM_AA_D_ID' ] except KeyError : android_id = input ( u"Device ID ('mac' for FROM_MAC_ADDRESS): " ) if ( android_id == u'mac' ) : android_id = Mobileclient . FROM_MAC_ADDRESS if ( not android_id ) : print ( u'a device id must be provided' ) sys . exit ( 1 ) valid_mc_auth = mclient . login ( email , passwd , android_id ) return ( email , passwd , android_id )
return a valid tuple by continually prompting the user .