def list_bans(banlist):
 if (not banlist):
  return 'No active bans were found.'
 table = prettytable.PrettyTable(['{wid', '{wname/ip', '{wdate', '{wreason'])
 for (inum, ban) in enumerate(banlist):
  table.add_row([str((inum + 1)), ((ban[0] and ban[0]) or ban[1]), ban[3], ban[4]])
 string = ('{wActive bans:{n\n%s' % table)
 return string

def list_bans ( banlist ) : if ( not banlist ) : return 'No active bans were found.' table = prettytable . PrettyTable ( [ '{wid' , '{wname/ip' , '{wdate' , '{wreason' ] ) for ( inum , ban ) in enumerate ( banlist ) : table . add_row ( [ str ( ( inum + 1 ) ) , ( ( ban [ 0 ] and ban [ 0 ] ) or ban [ 1 ] ) , ban [ 3 ] , ban [ 4 ] ] ) string = ( '{wActive bans:{n\n%s' % table ) return string
helper function to display a list of active bans .