示例#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)
示例#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)
示例#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))
示例#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))
示例#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)
示例#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)