added lodgeit.wsgi file

This commit is contained in:
mitsuhiko 2008-06-23 12:49:53 +02:00
parent cde440c798
commit a0794b8bce
2 changed files with 11 additions and 1 deletions

9
lodgeit.wsgi Normal file
View File

@ -0,0 +1,9 @@
# Example lodgeit file
from lodgeit import make_app
application = make_app(
# the path to the database
dburi='sqlite:////path/to/lodgeit.db',
# generate with os.urandom(30)
secret_key='\x05\x82bgI\x99\xaay\xa5o\xef\xac\xa1\x93>Db\x04\xf1\x8b|\x7fT\x87|]LcM\x9d'
)

View File

@ -34,9 +34,10 @@ class AntiSpam(object):
"""
def check_for_link_spam(self, code):
"""It's spam if more than 30% of the text are links."""
lengths = (x.span() for x in LINK_RE.finditer(code))
return percentize(sum(i[1]-i[0] for i in lengths),
len(code)) > 50
len(code)) > 30
def is_spam(self, code):
"""Check if one of the fields provides contains spam."""