diff options
author | Alon Zakai <azakai@mozilla.com> | 2011-03-05 18:41:15 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2011-03-05 18:41:15 -0800 |
commit | 749e2d5031af8567a5a0a7db3d12cf6b65035ca6 (patch) | |
tree | 69fdca2b5e004679d83e7bf6bbf42c3467658514 /tools/shared.py | |
parent | 6db5de718d90cbbc6653cde526c53bd1b7b895a1 (diff) |
openjpeg demo
Diffstat (limited to 'tools/shared.py')
-rw-r--r-- | tools/shared.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/shared.py b/tools/shared.py index 78b18ba7..a0698d09 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -41,3 +41,21 @@ def to_cc(cxx): # By default, LLVM_GCC and CLANG are really the C++ versions. This gets an explicit C version return cxx.replace('clang++', 'clang').replace('g++', 'gcc') +def line_splitter(data): + ''' + Silly little tool to split JSON arrays over many lines. + ''' + + out = '' + counter = 0 + + for i in range(len(data)): + out += data[i] + if data[i] == ' ' and counter > 60: + out += '\n' + counter = 0 + else: + counter += 1 + + return out + |