96 text_colour = colorama.Fore.LIGHTRED_EX |
96 text_colour = colorama.Fore.LIGHTRED_EX |
97 elif problem['type'] == 'warning': |
97 elif problem['type'] == 'warning': |
98 text_colour = colorama.Fore.LIGHTYELLOW_EX |
98 text_colour = colorama.Fore.LIGHTYELLOW_EX |
99 else: |
99 else: |
100 text_colour = '' |
100 text_colour = '' |
|
101 ldraw_code = model.body[problem['body-index']].textual_representation() |
101 message = str.format( |
102 message = str.format( |
102 '{text_colour}{model_name}:{line_number}: {problem_type}: {message}' |
103 '{text_colour}{model_name}:{line_number}: {problem_type}: {message}' |
103 '{colour_reset}\n\t{trouble_source}', |
104 '{colour_reset}\n\t{ldraw_code}', |
104 text_colour = text_colour, |
105 text_colour = text_colour, |
105 model_name = model.name, |
106 model_name = model.name, |
106 line_number = problem['line-number'], |
107 line_number = problem['line-number'], |
107 problem_type = problem['type'], |
108 problem_type = problem['type'], |
108 message = problem_text, |
109 message = problem_text, |
109 colour_reset = colorama.Fore.RESET, |
110 colour_reset = colorama.Fore.RESET, |
110 trouble_source = model.body[problem['body-index']].original_code, |
111 ldraw_code = ldraw_code, |
111 ) |
112 ) |
112 result.append((problem['line-number'], message)) |
113 result.append((problem['line-number'], message)) |
113 return '\n'.join( |
114 return '\n'.join( |
114 problem[1] |
115 problem[1] |
115 for problem in sorted(result) |
116 for problem in sorted(result) |