Esempio n. 1
0
def movie_list_lists(options):
    """ Show all movie lists """
    lists = get_movie_lists()
    console('Existing movie lists:')
    console('-' * 20)
    for movie_list in lists:
        console(movie_list.name)
Esempio n. 2
0
 def get(self, session=None):
     """ Gets movies lists """
     args = movie_list_parser.parse_args()
     name = args.get('name')
     movie_lists = [
         movie_list.to_dict()
         for movie_list in ml.get_movie_lists(name=name, session=session)
     ]
     return jsonify(movie_lists)
Esempio n. 3
0
def movie_list_lists(options):
    """ Show all movie lists """
    lists = get_movie_lists()
    header = ['#', 'List Name']
    table_data = [header]
    for movie_list in lists:
        table_data.append([movie_list.id, movie_list.name])
    table = TerminalTable(options.table_type, table_data)
    try:
        console(table.output)
    except TerminalTableError as e:
        console('ERROR: %s' % str(e))
Esempio n. 4
0
def movie_list_lists(options):
    """ Show all movie lists """
    lists = get_movie_lists()
    header = ["#", "List Name"]
    table_data = [header]
    for movie_list in lists:
        table_data.append([movie_list.id, movie_list.name])
    table = TerminalTable(options.table_type, table_data)
    try:
        console(table.output)
    except TerminalTableError as e:
        console("ERROR: %s" % str(e))
Esempio n. 5
0
def movie_list_lists(options):
    """ Show all movie lists """
    lists = get_movie_lists()
    header = ['#', 'List Name']
    table_data = [header]
    for movie_list in lists:
        table_data.append([movie_list.id, movie_list.name])
    try:
        table = TerminalTable(options.table_type, table_data)
    except TerminalTableError as e:
        console('ERROR: {}'.format(e))
    else:
        console(table.output)
Esempio n. 6
0
 def get(self, session=None):
     """ Gets movies lists """
     args = movie_list_parser.parse_args()
     name = args.get("name")
     movie_lists = [movie_list.to_dict() for movie_list in ml.get_movie_lists(name=name, session=session)]
     return jsonify(movie_lists)