summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlasdair Colley <alnessy@hotmail.com>2014-07-17 17:18:06 +0200
committerAlasdair Colley <alnessy@hotmail.com>2014-07-17 17:18:06 +0200
commit10a3d0e498b9305809c6efdefc25da994f458666 (patch)
tree524979e4d44ab9b418bf09d74f94ba93069258ca
parent3587745199bfb4e2c546f9ad1bdd484692c42162 (diff)
adding migration script to convert old blasource entries to the new format
-rwxr-xr-xmigrate17
1 files changed, 17 insertions, 0 deletions
diff --git a/migrate b/migrate
new file mode 100755
index 0000000..60bef33
--- /dev/null
+++ b/migrate
@@ -0,0 +1,17 @@
+#! /usr/bin/env python
+
+import json
+import sys
+
+ENTRIES_FILE = "saucypy.json"
+
+def main():
+ source = sys.argv[1] # 'source', get it?
+ data = {}
+ for line in open( source ):
+ key, value = line.split()
+ data[key] = value
+ json.dump( data, open( ENTRIES_FILE, "w" ), indent = 4, sort_keys = True )
+
+if __name__ == "__main__":
+ main()