diff options
author | zhifeng.jiang <jiang.zhifeng@zte.com.cn> | 2016-07-12 22:36:43 +0800 |
---|---|---|
committer | zhifeng jiang <jiang.zhifeng@zte.com.cn> | 2016-07-13 01:51:02 +0000 |
commit | f385a6d107b3c5c479583e74e18ef3c5fa55b304 (patch) | |
tree | d28028bc5fd404ae560ee6cb21e0dc365ac7c550 /data/report/get_results.py | |
parent | 01c843df1684678072988283b3789e11a34b7499 (diff) |
Fix pep8 errors for python files in benchmarks,data,dashboard
JIRA:QTIP-89
Change-Id: I3465221f0bdc9a8eb7c4e26069f7367fb1add729
Signed-off-by: zhifeng.jiang <jiang.zhifeng@zte.com.cn>
Diffstat (limited to 'data/report/get_results.py')
-rw-r--r-- | data/report/get_results.py | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/data/report/get_results.py b/data/report/get_results.py index 01fb8080..23fd5383 100644 --- a/data/report/get_results.py +++ b/data/report/get_results.py @@ -2,48 +2,49 @@ import os import json -def report_concat (targ_dir, testcase): - machine_temp=[]; - machines=[]; - diction={}; +def report_concat(targ_dir, testcase): + machine_temp = [] + machines = [] for file in os.listdir(targ_dir): if file.endswith(".json"): machine_temp.append(file) - l=len(machine_temp) + l = len(machine_temp) - for x in range (0,l): - file_t=machine_temp[x] - with open (targ_dir+file_t) as result_file: - result_djson=json.load(result_file) + for x in range(0, l): + file_t = machine_temp[x] + with open(targ_dir + file_t) as result_file: + result_djson = json.load(result_file) if result_djson['1 Testcase Name'] == str(testcase): machines.append(result_djson) return machines + def space_count(l): - spc='' + spc = '' for x in range(l): - spc=spc+' ' + spc = spc + ' ' return spc -def custom_dict(list1,list2,k): - string_1='' - for num_1 in range (0,len(list1)): - string_1=string_1+space_count(k)+str(list1[num_1][0])+"="+str(list2[num_1])+"\n" +def custom_dict(list1, list2, k): + string_1 = '' + for num_1 in range(0, len(list1)): + string_1 = string_1 + space_count(k) + str(list1[num_1][0]) + "=" + str(list2[num_1]) + "\n" return string_1 -def generate_result(dict_a,k): - list_1=[] - list_2=[] - count=0 - for i,j in sorted(dict_a.iteritems()): + +def generate_result(dict_a, k): + list_1 = [] + list_2 = [] + count = 0 + for i, j in sorted(dict_a.iteritems()): list_1.append([]) list_1[count].append(i) if (str(type(dict_a.get(i)))) == "<type 'dict'>": - list_2.append(str("\n"+generate_result(dict_a.get(i),int(k+1)))) + list_2.append(str("\n" + generate_result(dict_a.get(i), int(k + 1)))) else: list_2.append(dict_a.get(i)) - count=count+1 - return custom_dict(list_1,list_2,k) + count = count + 1 + return custom_dict(list_1, list_2, k) |