Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai
nospam
Commits
73753983
Commit
73753983
authored
Jan 05, 2012
by
ale
Browse files
tiny fix for unbound local variable
parent
a908094d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
nospam/api.py
nospam/api.py
+2
-1
No files found.
nospam/api.py
View file @
73753983
...
...
@@ -86,6 +86,8 @@ class NoSpam(object):
# Find all the outgoing links in the comment text, and add
# them to the comment dictionary under the '_urls' key.
comment
[
'_urls'
]
=
self
.
_extract_urls
(
comment
)
# Compute the 'nice' site name (domain only, no http:// prefix).
site
=
_extract_domain
(
comment
[
'site'
])
# Test all plugins, then compare the total score against the
# spam threshold.
results
=
[]
...
...
@@ -102,7 +104,6 @@ class NoSpam(object):
comment
[
'train'
]
=
'spam'
self
.
classify
(
comment
)
msg
=
', '
.
join
([
x
[
1
]
for
x
in
results
if
x
[
0
]
>
0
])
site
=
_extract_domain
(
comment
[
'site'
])
log
.
info
(
'spam: site=%s score=%g %s'
%
(
site
,
tot_score
,
msg
))
self
.
_incr_counter
(
'spam'
,
site
)
return
(
True
,
tot_score
,
msg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment