From ef0429335517aefb95ac4aadeec747ae7226af95 Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Sat, 29 Jun 2024 16:34:47 +0200 Subject: [PATCH] Fixed #12. Added colors to parts and missing --- app.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app.py b/app.py index a2dcead..efcba92 100644 --- a/app.py +++ b/app.py @@ -453,6 +453,15 @@ def parts(): cursor.close() conn.close() + color_file = np.loadtxt("colors.csv",delimiter=",",dtype="str") + + color_dict = {str(code): name for code, name, _, _ in color_file} + + for item in missing_list: + color_code = str(item[2]) + if color_code in color_dict: + item[2] = color_dict[color_code] + return render_template('parts.html',missing_list=missing_list) @app.route('/minifigs',methods=['POST','GET'])