diff --git a/script.py b/script.py old mode 100644 new mode 100755 index f1be722..657a30a --- a/script.py +++ b/script.py @@ -1,10 +1,15 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: CC0-1.0 + from mako.template import Template import json -import itertools -import argparse -appTemplate = Template(filename='./spaces.html') -f = open('libregamingspaces.json') -spaces=json.load(f) +def render(spaces, template): + appTemplate = Template(filename=template) + print(appTemplate.render(s=spaces)) -print(appTemplate.render(s=spaces)) +if __name__ == '__main__': + with open('libregamingspaces.json') as f: + spaces = json.load(f) + + render(spaces, './spaces.html')