def action_list(options):
 with Session() as session:
  regexp_list = get_list_by_exact_name(options.list_name)
  if (not regexp_list):
   console(u'Could not find regexp list with name {}'.format(options.list_name))
   return
  header = [u'Regexp']
  table_data = [header]
  regexps = get_regexps_by_list_id(regexp_list.id, order_by=u'added', descending=True, session=session)
  for regexp in regexps:
   regexp_row = [(regexp.regexp or u'')]
   table_data.append(regexp_row)
 try:
  table = TerminalTable(options.table_type, table_data)
  console(table.output)
 except TerminalTableError as e:
  console((u'ERROR: %s' % str(e)))

def action_list ( options ) : with Session ( ) as session : regexp_list = get_list_by_exact_name ( options . list_name ) if ( not regexp_list ) : console ( u'Could not find regexp list with name {}' . format ( options . list_name ) ) return header = [ u'Regexp' ] table_data = [ header ] regexps = get_regexps_by_list_id ( regexp_list . id , order_by = u'added' , descending = True , session = session ) for regexp in regexps : regexp_row = [ ( regexp . regexp or u'' ) ] table_data . append ( regexp_row ) try : table = TerminalTable ( options . table_type , table_data ) console ( table . output ) except TerminalTableError as e : console ( ( u'ERROR: %s' % str ( e ) ) )
list regexp list .