def main(argv): if len(argv) < 2: print('Usage: python {0} <input> <expected show names>'.format(__file__)) sys.exit(1) show_list = argv[2:] for arg in show_list: app.showList.append(MockTvShow(arg)) cache.fallback() actual = guessit(argv[1]) results = ['# guessit: {} rebulk: {}'.format(guessit_version, rebulk_version)] if show_list: results.append('# show list: {}'.format(argv[2:])) results.append('? {}'.format(argv[1])) for key, value in iteritems(actual): fmt = ': {key}: {value}' if len(results) <= 2 else ' {key}: {value}' results.append(fmt.format(key=key, value=value)) print('\n'.join(results))
def main(argv): if len(argv) < 2: print( 'Usage: python {0} <input> <expected show names>'.format(__file__)) sys.exit(1) show_list = argv[2:] for arg in show_list: app.showList.append(MockTvShow(arg)) cache.fallback() actual = guessit(argv[1]) results = [ '# guessit: {} rebulk: {}'.format(guessit_version, rebulk_version) ] if show_list: results.append('# show list: {}'.format(argv[2:])) results.append('? {}'.format(argv[1])) for key, value in iteritems(actual): fmt = ': {key}: {value}' if len(results) <= 2 else ' {key}: {value}' results.append(fmt.format(key=key, value=value)) print('\n'.join(results))
def execute_before_any_test(): cache.fallback()