def movie_list_list(options):
 with Session() as session:
  try:
   movie_list = get_list_by_exact_name(options.list_name)
  except NoResultFound:
   console(u'Could not find movie list with name {}'.format(options.list_name))
   return
 header = [u'#', u'Movie Name', u'Movie year']
 header += MovieListBase().supported_ids
 table_data = [header]
 movies = get_movies_by_list_id(movie_list.id, order_by=u'added', descending=True, session=session)
 for movie in movies:
  movie_row = [movie.id, movie.title, (movie.year or u'')]
  for identifier in MovieListBase().supported_ids:
   movie_row.append(movie.identifiers.get(identifier, u''))
  table_data.append(movie_row)
 title = u'{} Movies in movie list: `{}`'.format(len(movies), options.list_name)
 try:
  table = TerminalTable(options.table_type, table_data, title, drop_columns=[5, 2, 4])
 except TerminalTableError as e:
  console(u'ERROR: {}'.format(e))
 else:
  console(table.output)

def movie_list_list ( options ) : with Session ( ) as session : try : movie_list = get_list_by_exact_name ( options . list_name ) except NoResultFound : console ( u'Could not find movie list with name {}' . format ( options . list_name ) ) return header = [ u'#' , u'Movie Name' , u'Movie year' ] header += MovieListBase ( ) . supported_ids table_data = [ header ] movies = get_movies_by_list_id ( movie_list . id , order_by = u'added' , descending = True , session = session ) for movie in movies : movie_row = [ movie . id , movie . title , ( movie . year or u'' ) ] for identifier in MovieListBase ( ) . supported_ids : movie_row . append ( movie . identifiers . get ( identifier , u'' ) ) table_data . append ( movie_row ) title = u'{} Movies in movie list: `{}`' . format ( len ( movies ) , options . list_name ) try : table = TerminalTable ( options . table_type , table_data , title , drop_columns = [ 5 , 2 , 4 ] ) except TerminalTableError as e : console ( u'ERROR: {}' . format ( e ) ) else : console ( table . output )
list movie list .