From e92fdc78332bcdcac4062ea1d95ae84a358042e4 Mon Sep 17 00:00:00 2001 From: poikilos <7557867+poikilos@users.noreply.github.com> Date: Wed, 23 Mar 2016 12:16:06 -0400 Subject: [PATCH] now uses colors - invisible.txt --- minetestinfo.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/minetestinfo.py b/minetestinfo.py index 17698b3..e141739 100644 --- a/minetestinfo.py +++ b/minetestinfo.py @@ -415,7 +415,25 @@ def init_minetestinfo(): print(" ...") appended_count += 1 print(" "+singular_or_plural("entry","entries",appended_count)+" appended from "+sub_name) - + exclusions_path = os.path.join( os.path.dirname(os.path.abspath(__file__)), "colors - invisible.txt") + exclusions_list = list() + if os.path.isfile(exclusions_path): + ins = open(this_genresult_path, 'r') + line = True + counting_number = 1 + while line: + participle = "reading line "+str(counting_number) + line = ins.readline() + if line: + line_strip = line.strip() + if len(line_strip)>0: + exclusions_list.append(line_strip) + else: + print("Missing "+exclusions_path) + for this_key in merged_colors.keys(): + if this_key in exclusions_list: + merged_colors.remove(this_key) + print("Removed invisible block '"+this_key+"'") save_conf_from_dict(dest_colors_txt, merged_colors, assignment_operator=" ") else: print("Using colors from "+dest_colors_txt)