diff options
author | Dafydd Harries <daf@rhydd.org> | 2013-03-20 19:37:16 -0400 |
---|---|---|
committer | Dafydd Harries <daf@rhydd.org> | 2013-03-20 19:37:16 -0400 |
commit | aaa1c9386c1bdb1267cef04145d9c3c3cc76ea60 (patch) | |
tree | a7eeb2755edbde39830429eb4700e41e6dc8ac31 | |
parent | 5116d66561f188a7098be0f9b99b8ddb71ae0fc5 (diff) |
add export_json.py script
-rw-r--r-- | export_json.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/export_json.py b/export_json.py new file mode 100644 index 0000000..e2c20ae --- /dev/null +++ b/export_json.py @@ -0,0 +1,25 @@ + +import json +import sys + +import export + +def main(): + data = export.PkgData() + everything = {} + + for (name, templates) in export.export_all(data): + page = [] + + for template in templates: + tname = template.name + values = dict(template.values) + page.append((tname, values)) + + everything[name] = page + + json.dump(everything, sys.stdout, indent=2) + +if __name__ == '__main__': + main() + |