Index: Source/devtools/scripts/concatenate_module_descriptors.py |
diff --git a/Source/devtools/scripts/concatenate_module_descriptors.py b/Source/devtools/scripts/concatenate_module_descriptors.py |
index b53ad3565a0a5e584be45e8c0f12b310edd60c42..2745dbda322b2c692b114749f1f529b50979e697 100755 |
--- a/Source/devtools/scripts/concatenate_module_descriptors.py |
+++ b/Source/devtools/scripts/concatenate_module_descriptors.py |
@@ -10,6 +10,10 @@ |
import errno |
import shutil |
import sys |
+try: |
+ import simplejson as json |
+except ImportError: |
+ import json |
def read_file(filename): |
@@ -23,9 +27,17 @@ |
if not path.exists(json_filename): |
continue |
module_name = path.basename(path.dirname(json_filename)) |
- json = read_file(json_filename).replace('{', '{"name":"%s",' % module_name, 1) |
- result.append(json) |
- return ','.join(result) |
+ |
+ # pylint: disable=E1103 |
+ module_json = json.loads(read_file(json_filename)) |
+ module_json['name'] = module_name |
+ |
+ # Clear scripts, as they are not used at runtime |
+ # (only the fact of their presence is important). |
+ if module_json.get('scripts'): |
+ module_json['scripts'] = [] |
+ result.append(module_json) |
+ return json.dumps(result) |
def main(argv): |
@@ -34,7 +46,7 @@ |
module_jsons = argv[3:] |
with open(output_filename, 'w') as output_file: |
- output_file.write('var allDescriptors=[%s];' % build_modules(module_jsons)) |
+ output_file.write('var allDescriptors=%s;' % build_modules(module_jsons)) |
if __name__ == '__main__': |