From 5d67fdf522b7ba460f8337e3c6cfea3b340c46f8 Mon Sep 17 00:00:00 2001 From: zhihui wu Date: Mon, 18 Sep 2017 13:46:43 +0800 Subject: delete legacy code from branch stable/euphrates This directory doesn't need to publish in euphrates. Change-Id: I2d88b85c272ca3df6cc504e08968e9432e2dd96d Signed-off-by: zhihui wu --- legacy/utils/report/get_results.py | 58 -------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 legacy/utils/report/get_results.py (limited to 'legacy/utils/report/get_results.py') diff --git a/legacy/utils/report/get_results.py b/legacy/utils/report/get_results.py deleted file mode 100644 index 6df88235..00000000 --- a/legacy/utils/report/get_results.py +++ /dev/null @@ -1,58 +0,0 @@ -############################################################################## -# Copyright (c) 2017 ZTE Corporation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -import os -import json - - -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) - - 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 = '' - for x in range(l): - 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" - return string_1 - - -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)))) == "": - 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) -- cgit 1.2.3-korg