30 lines
850 B
Python
Executable File
30 lines
850 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import argparse
|
|
import aoclib
|
|
import os
|
|
|
|
argument_parser = argparse.ArgumentParser()
|
|
argument_parser.add_argument("day", help="specify day to process; leave empty for ALL days")
|
|
argument_parser.add_argument("-t", "--test", help="also run test cases", action="store_true", default=False)
|
|
argument_parser.add_argument("-d", "--debug", help="turn on debug mode", action="store_true", default=False)
|
|
flags = argument_parser.parse_args()
|
|
|
|
DEBUG = flags.debug
|
|
|
|
day = ""
|
|
if flags.day:
|
|
day = "%02d" % int(flags.day)
|
|
|
|
for _, _, files in os.walk(aoclib.BASE_PATH):
|
|
for f in files:
|
|
if f.startswith('day' + day) and f.endswith('.py'):
|
|
if flags.test:
|
|
TEST = True
|
|
exec(open(f).read())
|
|
else:
|
|
TEST = False
|
|
exec(open(f).read())
|
|
|
|
break
|