diff --git a/py-scripts/tools/ct_us_001_rig.json b/py-scripts/tools/ct_us_001_rig.json index 27cd5fdc..fc4163b4 100644 --- a/py-scripts/tools/ct_us_001_rig.json +++ b/py-scripts/tools/ct_us_001_rig.json @@ -45,8 +45,4 @@ "1.1.wiphy6":{"KEY":"1.1.wiphy6","RADIO":"1.1.wiphy6","DRIVER":"iwlwifi(AX210)","CAPABILITIES":"802.11abgn-AX","MAX_STA":"1","MAX_VAP":"1","MAX_VIFS":"1"}, "1.1.wiphy7":{"KEY":"1.1.wiphy7","RADIO":"1.1.wiphy7","DRIVER":"mt7915e()","CAPABILITIES":"802.11abgn-AX","MAX_STA":"19","MAX_VAP":"16","MAX_VIFS":"19"} } -} - - - - \ No newline at end of file +} \ No newline at end of file diff --git a/py-scripts/tools/lf_json_convert.py b/py-scripts/tools/lf_json_convert.py new file mode 100755 index 00000000..5f188d44 --- /dev/null +++ b/py-scripts/tools/lf_json_convert.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 +''' +File: read in .json and convert for cookbook +Usage: lf_json_convert.py --file +Example: lf_json_convert.py --file +''' +# visit http://127.0.0.1:8050/ in your web browser. +import sys +import os +import importlib +import argparse + +class file_convert(): + def __init__(self, + _file = ''): + self.file = _file + self.file2 = "{}_edit".format(_file) + + # Helper methods + def json_file(self): + file_fd = open(self.file, 'r') + file2_fd = open(self.file2, 'w+') + file2_fd.write('{\n') + file2_fd.write('"text": [ "
{",')
+        for line in file_fd:
+            #print(line)
+            line = line.replace('"','"').replace('\n','')
+            line = '"' + line + '\\n",'
+            file2_fd.write('{}\n'.format(line))
+        file2_fd.write('"
"]\n') + file2_fd.write('},') + file_fd.close() + file2_fd.close() + +# Feature, Sum up the subtests passed/failed from the kpi files for each run, poke those into the database, and generate a kpi graph for them. +def main(): + + parser = argparse.ArgumentParser( + prog='lf_json_convert.py', + formatter_class=argparse.RawTextHelpFormatter, + epilog='''\ + lf_json_convert.py converts json for cookbook the output is _edit + + ''', + description='''\ +File: read in .json and convert for cookbook +Usage: lf_json_convert.py --file +Example: lf_json_convert.py --file + + ''') + parser.add_argument('--file', help='--file file.json', required=True) #TODO is this needed + + args = parser.parse_args() + + __file = args.file + + convert = file_convert(_file = __file) + convert.json_file() + +if __name__ == '__main__': + main() +