aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--export_json.py25
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()
+