X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_tables.py;h=59059df08eada0bf937a1e0802e18ec1218b5f67;hp=0ff4de6c0893e7b9eba7ab0d8763bcf800297c30;hb=f12e62b5d43bdc3765b167a17887e2e441e902eb;hpb=a2176b15e68b22277cbcd959de67c8fd169fec78 diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py index 0ff4de6c08..59059df08e 100644 --- a/resources/tools/presentation/generator_tables.py +++ b/resources/tools/presentation/generator_tables.py @@ -134,6 +134,8 @@ def table_performance_improvements(table, input_data): line_lst.append(item["data"]) elif isinstance(item["data"], float): line_lst.append("{:.1f}".format(item["data"])) + elif item["data"] is None: + line_lst.append("") file_handler.write(",".join(line_lst) + "\n") logging.info(" Generating the table {0} ...". @@ -184,17 +186,24 @@ def table_performance_improvements(table, input_data): ["value"]) / 1000000) except (KeyError, TypeError): # No data, ignore - pass + continue if data_lst: tbl_item.append({"data": eval(operation)(data_lst)}) + else: + tbl_item.append({"data": None}) elif cmd == "operation": operation = args[0] - nr1 = tbl_item[int(args[1])]["data"] - nr2 = tbl_item[int(args[2])]["data"] - if nr1 and nr2: - tbl_item.append({"data": eval(operation)(nr1, nr2)}) - else: + try: + nr1 = tbl_item[int(args[1])]["data"] + nr2 = tbl_item[int(args[2])]["data"] + if nr1 and nr2: + tbl_item.append({"data": eval(operation)(nr1, nr2)}) + else: + tbl_item.append({"data": None}) + except IndexError: + logging.error("No data for {0}".format(tbl_item[1]["data"])) tbl_item.append({"data": None}) + continue else: logging.error("Not supported command {0}. Skipping the table.". format(cmd))