def GetEmail(prompt):
 last_email_file_name = os.path.expanduser('~/.last_codereview_email_address')
 last_email = ''
 if os.path.exists(last_email_file_name):
  try:
   last_email_file = open(last_email_file_name, 'r')
   last_email = last_email_file.readline().strip('\n')
   last_email_file.close()
   prompt += (' [%s]' % last_email)
  except IOError as e:
   pass
 email = raw_input((prompt + ': ')).strip()
 if email:
  try:
   last_email_file = open(last_email_file_name, 'w')
   last_email_file.write(email)
   last_email_file.close()
  except IOError as e:
   pass
 else:
  email = last_email
 return email

def GetEmail ( prompt ) : last_email_file_name = os . path . expanduser ( '~/.last_codereview_email_address' ) last_email = '' if os . path . exists ( last_email_file_name ) : try : last_email_file = open ( last_email_file_name , 'r' ) last_email = last_email_file . readline ( ) . strip ( '\n' ) last_email_file . close ( ) prompt += ( ' [%s]' % last_email ) except IOError as e : pass email = raw_input ( ( prompt + ': ' ) ) . strip ( ) if email : try : last_email_file = open ( last_email_file_name , 'w' ) last_email_file . write ( email ) last_email_file . close ( ) except IOError as e : pass else : email = last_email return email
prompts the user for their email address and returns it .