def full_class(roll): data = [] data.extend(get_data(roll)) print_data(data) save_stdout = sys.stdout branch_name = get_branch_name(get_branch(roll)) verify_folder(abs_path('./result/' + branch_name)) data.sort(key=sort_sgpa, reverse=True) sys.stdout = open( 'result/' + branch_name + '/' + branch_name + '_' + get_year(roll) + '_sgpi.txt', 'w') print("sorting by sgpi....\n\n\n") print_data(data) data.sort(key=sort_cgpa, reverse=True) sys.stdout = open( 'result/' + branch_name + '/' + branch_name + '_' + get_year(roll) + '_cgpi.txt', 'w') print("sorting by cgpi....\n\n\n") print_data(data) sys.stdout = save_stdout print("written into files in result folder....\n\n") if (dump_it): dump_data(data, default_file_name)
def __init__(self): self.user_list = {} self.output_dir = "./bin/out/" verify_folder(self.output_dir) self.output_file = self.output_dir + "log.txt" verify_file(self.output_file) self.fout = open(self.output_file,'w')
def full_year(roll): data = [] y = get_year(roll) classes = get_class_set(y) verify_folder(abs_path('./result')) save_stdout = sys.stdout for roll in classes: class_data = get_data(roll) branch_name = get_branch_name(get_branch(roll)) verify_folder(abs_path('./result/' + branch_name)) class_data.sort(key=sort_sgpa, reverse=True) sys.stdout = open( 'result/' + branch_name + '/' + branch_name + '_' + get_year(roll) + '_sgpi.txt', 'w') print("sorting by sgpi....\n\n\n") print_data(class_data) class_data.sort(key=sort_cgpa, reverse=True) sys.stdout = open( 'result/' + branch_name + '/' + branch_name + '_' + get_year(roll) + '_cgpi.txt', 'w') print("sorting by cgpi....\n\n\n") print_data(class_data) data.extend(class_data) sys.stdout = save_stdout verify_folder(abs_path('./result/FULL_YEAR')) data.sort(key=sort_sgpa, reverse=True) sys.stdout = open( 'result/FULL_YEAR/full_year_' + get_year(roll) + '_sgpi.txt', 'w') print("sorting by sgpi....\n\n\n") print_data(data) data.sort(key=sort_cgpa, reverse=True) sys.stdout = open( 'result/FULL_YEAR/full_year_' + get_year(roll) + '_cgpi.txt', 'w') print("sorting by cgpi....\n\n\n") print_data(data) sys.stdout = save_stdout print("written into files in result folder....\n\n") if (dump_it): dump_data(data, default_file_name)
def full_college(): data = [] by = base_year roll_set = [] for b in range(0, 4): roll_set.append(str(by - b) + 'mi535') save_stdout = sys.stdout for roll in roll_set: year_data = [] y = get_year(roll) classes = get_class_set(y) verify_folder(abs_path('./result')) for roll in classes: class_data = get_data(roll) branch_name = get_branch_name(get_branch(roll)) verify_folder(abs_path('./result/' + branch_name)) class_data.sort(key=sort_sgpa, reverse=True) sys.stdout = open( 'result/' + branch_name + '/' + branch_name + '_' + get_year(roll) + '_sgpi.txt', 'w') print("sorting by sgpi....\n\n\n") print_data(class_data) class_data.sort(key=sort_cgpa, reverse=True) sys.stdout = open( 'result/' + branch_name + '/' + branch_name + '_' + get_year(roll) + '_cgpi.txt', 'w') print("sorting by cgpi....\n\n\n") print_data(class_data) year_data.extend(class_data) sys.stdout = save_stdout verify_folder(abs_path('./result/FULL_YEAR')) year_data.sort(key=sort_sgpa, reverse=True) sys.stdout = open( 'result/FULL_YEAR/full_year_' + get_year(roll) + '_sgpi.txt', 'w') print("sorting by sgpi....\n\n\n") print_data(year_data) year_data.sort(key=sort_cgpa, reverse=True) sys.stdout = open( 'result/FULL_YEAR/full_year_' + get_year(roll) + '_cgpi.txt', 'w') print("sorting by cgpi....\n\n\n") print_data(year_data) sys.stdout = save_stdout data.extend(year_data) verify_folder(abs_path('./result/FULL_COLLEGE')) data.sort(key=sort_sgpa, reverse=True) sys.stdout = open('result/FULL_COLLEGE/full_college_sgpi.txt', 'w') print("sorting by sgpi....\n\n\n") print_data(data) data.sort(key=sort_cgpa, reverse=True) sys.stdout = open('result/FULL_COLLEGE/full_college_cgpi.txt', 'w') print("sorting by cgpi....\n\n\n") print_data(data) sys.stdout = save_stdout print("written into files in result folder....\n\n") if (dump_it): dump_data(data, default_file_name)