forked from Archive/PX4-Autopilot
metadata: sort json output
ensures the files don't change arbitrarily
This commit is contained in:
parent
06a0aedbdb
commit
02035d94aa
|
@ -489,7 +489,7 @@ actuators = {
|
|||
|
||||
with open(output_file, 'w') as outfile:
|
||||
indent = 2 if verbose else None
|
||||
json.dump(actuators, outfile, indent=indent)
|
||||
json.dump(actuators, outfile, indent=indent, sort_keys=True)
|
||||
|
||||
if compress:
|
||||
save_compressed(output_file)
|
||||
|
|
|
@ -74,7 +74,7 @@ for metadata_type_tuple in args.type:
|
|||
component_general['metadataTypes'] = metadata_types
|
||||
|
||||
with open(filename, 'w') as outfile:
|
||||
json.dump(component_general, outfile)
|
||||
json.dump(component_general, outfile, sort_keys=True)
|
||||
|
||||
if compress:
|
||||
save_compressed(filename)
|
||||
|
|
|
@ -114,7 +114,7 @@ class JsonOutput():
|
|||
|
||||
|
||||
#Json string output.
|
||||
self.output = json.dumps(all_json,indent=2)
|
||||
self.output = json.dumps(all_json, indent=2, sort_keys=True)
|
||||
|
||||
|
||||
def Save(self, filename):
|
||||
|
|
|
@ -4,7 +4,6 @@ Param source code generation script.
|
|||
"""
|
||||
from __future__ import print_function
|
||||
import xml.etree.ElementTree as ET
|
||||
import codecs
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
|
|
|
@ -50,9 +50,7 @@ import argparse
|
|||
from px4params import srcscanner, srcparser, injectxmlparams, xmlout, markdownout, jsonout
|
||||
|
||||
import lzma #to create .xz file
|
||||
import re
|
||||
import json
|
||||
import codecs
|
||||
|
||||
def save_compressed(filename):
|
||||
#create lzma compressed version
|
||||
|
|
Loading…
Reference in New Issue