aboutsummaryrefslogtreecommitdiff
path: root/tools/make_file.py
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2011-02-27 16:55:53 -0800
committerAlon Zakai <azakai@mozilla.com>2011-02-27 16:55:53 -0800
commit6b7f4ffa844bd3e1f2690af2501807e1da161034 (patch)
tree49ac3a5e35a09b09a1a2ad7aebbb8e9a6c86f263 /tools/make_file.py
parente932e70792a50786dedc0461697ed31c7ffa4bb2 (diff)
openjpeg test
Diffstat (limited to 'tools/make_file.py')
-rw-r--r--tools/make_file.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/make_file.py b/tools/make_file.py
new file mode 100644
index 00000000..9568ff40
--- /dev/null
+++ b/tools/make_file.py
@@ -0,0 +1,18 @@
+'''
+Takes the output from a JS test, and creates a file from it. So if
+you do JSON.stringify() of an array in JS, this script will take
+that and make a proper file out of it
+'''
+
+import os, sys, re
+
+data = open(sys.argv[1], 'r').read()
+m = re.search('\[[\d, ]*\]', data)
+data = eval(m.group(0))
+string = ''.join([chr(item) for item in data])
+out = open(sys.argv[1]+'.raw', 'wb')
+print data[0:80]
+print string[0:80]
+out.write(string)
+out.close()
+