Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for line in lines:
i += 1
e = []
if line[mva.logoffset:].startswith('ERROR'):
e = lines[(max(i - 15, 0)):(min(i + 16, len(lines)))]
elog = elog + e
if len(elog) == 0 and len(output) > lst_len: # no error and LST output
return HTML(output)
elif len(elog) == 0 and len(output) <= lst_len: # no error and no LST
color_log = highlight(log, SASLogLexer(), HtmlFormatter(full=True, style=SASLogStyle, lineseparator="<br>"))
return HTML(color_log)
elif len(elog) > 0 and len(output) <= lst_len: # error and no LST
color_log = highlight(log, SASLogLexer(), HtmlFormatter(full=True, style=SASLogStyle, lineseparator="<br>"))
return HTML(color_log)
else: # errors and LST
color_log = highlight(log, SASLogLexer(), HtmlFormatter(full=True, style=SASLogStyle, lineseparator="<br>"))
return HTML(color_log + output)