def password(caller, string_input):
 menutree = caller.ndb._menutree
 string_input = string_input.strip()
 player = menutree.player
 password_attempts = (menutree.password_attempts if hasattr(menutree, 'password_attempts') else 0)
 bans = ServerConfig.objects.conf('server_bans')
 banned = (bans and (any(((tup[0] == player.name.lower()) for tup in bans)) or any((tup[2].match(caller.address) for tup in bans if tup[2]))))
 if (not player.check_password(string_input)):
  password_attempts += 1
  if (password_attempts > 2):
   caller.sessionhandler.disconnect(caller, '|rToo many failed attempts. Disconnecting.|n')
   text = ''
   options = {}
  else:
   menutree.password_attempts = password_attempts
   text = dedent('\n                |rIncorrect password.|n\n                Try again or leave empty to go back.\n            '.strip('\n'))
   options = ({'key': '', 'exec': (lambda caller: caller.msg('', options={'echo': True})), 'goto': 'start'}, {'key': '_default', 'goto': 'password'})
 elif banned:
  string = dedent('\n            |rYou have been banned and cannot continue from here.\n            If you feel this ban is in error, please email an admin.|n\n            Disconnecting.\n        '.strip('\n'))
  caller.sessionhandler.disconnect(caller, string)
  text = ''
  options = {}
 else:
  text = ''
  options = {}
  caller.msg('', options={'echo': True})
  caller.sessionhandler.login(caller, player)
 return (text, options)

def password ( caller , string_input ) : menutree = caller . ndb . _menutree string_input = string_input . strip ( ) player = menutree . player password_attempts = ( menutree . password_attempts if hasattr ( menutree , 'password_attempts' ) else 0 ) bans = ServerConfig . objects . conf ( 'server_bans' ) banned = ( bans and ( any ( ( ( tup [ 0 ] == player . name . lower ( ) ) for tup in bans ) ) or any ( ( tup [ 2 ] . match ( caller . address ) for tup in bans if tup [ 2 ] ) ) ) ) if ( not player . check_password ( string_input ) ) : password_attempts += 1 if ( password_attempts > 2 ) : caller . sessionhandler . disconnect ( caller , '|rToo many failed attempts. Disconnecting.|n' ) text = '' options = { } else : menutree . password_attempts = password_attempts text = dedent ( '\n                |rIncorrect password.|n\n                Try again or leave empty to go back.\n            ' . strip ( '\n' ) ) options = ( { 'key' : '' , 'exec' : ( lambda caller : caller . msg ( '' , options = { 'echo' : True } ) ) , 'goto' : 'start' } , { 'key' : '_default' , 'goto' : 'password' } ) elif banned : string = dedent ( '\n            |rYou have been banned and cannot continue from here.\n            If you feel this ban is in error, please email an admin.|n\n            Disconnecting.\n        ' . strip ( '\n' ) ) caller . sessionhandler . disconnect ( caller , string ) text = '' options = { } else : text = '' options = { } caller . msg ( '' , options = { 'echo' : True } ) caller . sessionhandler . login ( caller , player ) return ( text , options )
resets password for email to password .