Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main():
if len(sys.argv) != 2:
print >>sys.stderr, 'usage: overview.py destination_directory'
sys.exit(2)
with open('overview.tpl') as f:
template_text = f.read()
for day, end_time in zip(range(1, 6), [1730, 2030, 2045, 2045, 2045]):
random.seed(day)
scope = dict(
day=day,
t=Time((800 if day < 3 else 700), end_time, 2),
)
output = template(template_text, **scope)
path = os.path.join(sys.argv[1], 'overview{}.svg'.format(day))
with open(path, 'w') as f:
f.write(output.encode('utf-8'))