mirror of https://gitee.com/anolis/sysom.git
37 lines
815 B
Python
Executable File
37 lines
815 B
Python
Executable File
#!/usr/bin/python3
|
|
# coding=utf-8
|
|
import sys
|
|
import json
|
|
|
|
|
|
class schedmoni(object):
|
|
def __init__(self, f):
|
|
super(schedmoni, self).__init__()
|
|
self._file = f
|
|
|
|
def proc_data(self):
|
|
tmp = self._file.readlines()
|
|
print(tmp)
|
|
|
|
|
|
def extract_params():
|
|
path, res, task_id = sys.argv[1], "", sys.argv[2]
|
|
with open(path, 'r') as tmp:
|
|
res = tmp.read()
|
|
return res, task_id
|
|
|
|
|
|
if __name__ == "__main__":
|
|
str1, _ = extract_params()
|
|
str2 = str1.replace('\n', "")
|
|
str3 = str2.replace('\t', "")
|
|
data3 = json.loads(str3)
|
|
postprocess_result = {
|
|
"code": 0,
|
|
"err_msg": "",
|
|
"result": {}
|
|
}
|
|
postprocess_result["result"] = data3["datasources"]
|
|
data = json.dumps(postprocess_result, indent=4, ensure_ascii=False)
|
|
print(data)
|