From ebdf747494c0b89864e06ce1a032dd121f3a6727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Ko=CC=88rner?= Date: Mon, 26 Nov 2018 12:19:07 +0100 Subject: [PATCH] option to exclude specified ids --- make-apple-motion.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/make-apple-motion.py b/make-apple-motion.py index 0de15c6..8098809 100755 --- a/make-apple-motion.py +++ b/make-apple-motion.py @@ -40,6 +40,11 @@ parser.add_argument('--id', dest='ids', nargs='+', action="store", type=int, hel Usage: ./make.py yourproject/ --id 4711 0815 4223 1337 ''') +parser.add_argument('--exclude-id', dest='exclude_ids', nargs='+', action="store", type=int, help=''' + Do not render the given ID(s) from your projects schedule. + Usage: ./make.py yourproject/ --exclude-id 1 8 15 16 23 42 + ''') + args = parser.parse_args() def headline(str): @@ -187,11 +192,13 @@ def finalize_job(job_id, event): active_jobs = [] -print("enqueuing {} jobs into compressor".format(len(events))) -for event in events: - if args.ids and event['id'] not in args.ids: - continue +filtered_events = events +filtered_events = filter(lambda event: not args.ids or event['id'] in args.ids, filtered_events) +filtered_events = filter(lambda event: not args.exclude_ids or event['id'] not in args.exclude_ids, filtered_events) +filtered_events = list(filtered_events) +print("enqueuing {} jobs into compressor".format(len(filtered_events))) +for event in filtered_events: job_id = enqueue_job(event) if not job_id: event_print(event, "job was not enqueued successfully, skipping postprocessing")