This commit is contained in:
Renaud Boyer 2020-12-06 18:00:41 +01:00
parent fefbaeb143
commit fad64ff064
1 changed files with 3 additions and 3 deletions

View File

@ -74,7 +74,7 @@ class SpamAssassin(object):
first_line = match.group(1)
headers = match.group(2)
body = response[match.end(0) :]
body = response[match.end(0):]
# Checking response is good
match = first_line_pattern.match(first_line)
@ -87,7 +87,7 @@ class SpamAssassin(object):
s.strip() for s in body.decode("utf-8", errors="ignore").strip().split("\n")
]
linebreak_num = report_list.index([s for s in report_list if "---" in s][0])
tablelists = [s for s in report_list[linebreak_num + 1 :]]
tablelists = [s for s in report_list[linebreak_num + 1:]]
self.report_fulltext = "\n".join(report_list)
@ -108,7 +108,7 @@ class SpamAssassin(object):
# create final json
self.report_json = dict()
for tablelist in tablelists:
wordlist = re.split("\s+", tablelist)
wordlist = re.split(r"\s+", tablelist)
try:
self.report_json[wordlist[1]] = {
"partscore": float(wordlist[0]),