def pack_json_data(data, reportid): "creates the json for the svn pie charts" if reportid in [7, 8]: arg1 = 'url' elif reportid in [13, 14]: arg1 = 'query' else: arg1 = REPORT_DICT[reportid]['queryfield'] arg2 = REPORT_DICT[reportid]['order'].lstrip('-') ret = [] for index, item in enumerate(data): pie_data = {} pie_data['y'] = item[arg2] pie_data['color'] = PIE_COLORS[index] pie_data['stroke'] = 'black' pie_data['tooltip'] = obfuscation(str(item[arg1].split('/')[-1])) if reportid in [9, 10, 11, 12] else item[arg1].split('/')[-1] ret.append(pie_data) return ret
def tds_obfuscation(value): "obfuscation filter" return obfuscation(value)