diff --git a/main.py b/main.py index 8a5ffbab212511862795868ea3301e2869e49be1..72e48b50530a4bd2c248b352095cde76f259378d 100644 --- a/main.py +++ b/main.py @@ -13,14 +13,38 @@ # ********************************************************************************** """ import sys +import os +import json import argparse from src.utils.isocheck import IsoCheck +from src.utils import util -class kyClassifier: + +LAYERDATA = '/opt/kyclassifier/src/data/layer_data.json' +CLASSIFYDATA = '/opt/kyclassifier/src/data/classify_data.json' + +class kyClassifier(object): + @staticmethod def process_iso(iso_path): pass + @staticmethod + def save_output(pkg2layer,pkg2category): + JSON_OUTPATH = ( + (pkg2layer,'pkg2layer.json'), + (pkg2category,'pkg2category.json'), + ) + formatted_time = util.get_formatted_time() + dir_path = '/opt/kyclassifier/output/{}/'.format(formatted_time) + json_path = '{}json/'.format(dir_path) + os.makedirs(dir_path) + os.makedirs(json_path) + for tup in JSON_OUTPATH: + with open(json_path + tup[1],'w') as f: + json.dump(tup[0],f) + print(("Output json file saved at {}").format(json_path)) + if __name__ == '__main__': options = ['-h\n', diff --git a/src/data/classify_data.json b/src/data/classify_data.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/src/data/classify_data.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/data/layer_data.json b/src/data/layer_data.json new file mode 100644 index 0000000000000000000000000000000000000000..374cc9c63b87574e99fb327022d9031fec06c0e8 --- /dev/null +++ b/src/data/layer_data.json @@ -0,0 +1,6 @@ +{ + "1":[], + "2":[], + "3":[], + "4":[] +} \ No newline at end of file