aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDafydd Harries <daf@rhydd.org>2013-03-20 19:37:16 -0400
committerDafydd Harries <daf@rhydd.org>2013-03-20 19:37:16 -0400
commitaaa1c9386c1bdb1267cef04145d9c3c3cc76ea60 (patch)
treea7eeb2755edbde39830429eb4700e41e6dc8ac31
parent5116d66561f188a7098be0f9b99b8ddb71ae0fc5 (diff)
add export_json.py script
-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()
+