def get_email(invalid=False, optional=True):
 invalid_prefix = 'There seem to be problems with that address. '
 msg = 'Enter email address (used for urgent renewal and security notices)'
 unsafe_suggestion = '\n\nIf you really want to skip this, you can run the client with --register-unsafely-without-email but make sure you then backup your account key from /etc/letsencrypt/accounts\n\n'
 if optional:
  if invalid:
   msg += unsafe_suggestion
   suggest_unsafe = False
  else:
   suggest_unsafe = True
 else:
  suggest_unsafe = False
 while True:
  try:
   (code, email) = z_util(interfaces.IDisplay).input(((invalid_prefix + msg) if invalid else msg), force_interactive=True)
  except errors.MissingCommandlineFlag:
   msg = 'You should register before running non-interactively, or provide --agree-tos and --email <email_address> flags.'
   raise errors.MissingCommandlineFlag(msg)
  if (code != display_util.OK):
   if optional:
    raise errors.Error('An e-mail address or --register-unsafely-without-email must be provided.')
   else:
    raise errors.Error('An e-mail address must be provided.')
  elif util.safe_email(email):
   return email
  elif suggest_unsafe:
   msg += unsafe_suggestion
   suggest_unsafe = False
  invalid = bool(email)

def get_email ( invalid = False , optional = True ) : invalid_prefix = 'There seem to be problems with that address. ' msg = 'Enter email address (used for urgent renewal and security notices)' unsafe_suggestion = '\n\nIf you really want to skip this, you can run the client with --register-unsafely-without-email but make sure you then backup your account key from /etc/letsencrypt/accounts\n\n' if optional : if invalid : msg += unsafe_suggestion suggest_unsafe = False else : suggest_unsafe = True else : suggest_unsafe = False while True : try : ( code , email ) = z_util ( interfaces . IDisplay ) . input ( ( ( invalid_prefix + msg ) if invalid else msg ) , force_interactive = True ) except errors . MissingCommandlineFlag : msg = 'You should register before running non-interactively, or provide --agree-tos and --email <email_address> flags.' raise errors . MissingCommandlineFlag ( msg ) if ( code != display_util . OK ) : if optional : raise errors . Error ( 'An e-mail address or --register-unsafely-without-email must be provided.' ) else : raise errors . Error ( 'An e-mail address must be provided.' ) elif util . safe_email ( email ) : return email elif suggest_unsafe : msg += unsafe_suggestion suggest_unsafe = False invalid = bool ( email )
returns the email address for a user .