Move all logic related to score reasons until after we've checked if we have
reasons (mixed_unicode.py)
This commit is contained in:
parent
993403f213
commit
b8518d745f
1 changed files with 4 additions and 4 deletions
|
@ -77,11 +77,11 @@ class Module(ModuleManager.BaseModule):
|
||||||
reasons.extend([ScoreReason.AdditionalScript]*(len(scripts)-1))
|
reasons.extend([ScoreReason.AdditionalScript]*(len(scripts)-1))
|
||||||
|
|
||||||
score = len(reasons)
|
score = len(reasons)
|
||||||
|
if score > 0:
|
||||||
reasons_s = []
|
reasons_s = []
|
||||||
for reason, count in collections.Counter(reasons).items():
|
for reason, count in collections.Counter(reasons).items():
|
||||||
reasons_s.append("%s: %s" % (reason, count))
|
reasons_s.append("%s: %s" % (reason, count))
|
||||||
|
|
||||||
if score > 0:
|
|
||||||
self.log.trace(
|
self.log.trace(
|
||||||
"Message given a mixed-unicode score of %s (reasons: %s)",
|
"Message given a mixed-unicode score of %s (reasons: %s)",
|
||||||
[score, ", ".join(reasons_s)])
|
[score, ", ".join(reasons_s)])
|
||||||
|
|
Loading…
Reference in a new issue