Couple of akismet_comments patches

Michael Olson <mwolson-mXXj517/[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
Here are a couple of short patches against akismet_comments 0.3.

The first is fairly non-controversial, in that it fixes a "premature
end of headers" message that is caused by AkismetError not being
properly imported from akismet.py.

The second I'm not so sure about.  I noticed that when I tried to
submit comments to my own blog, the akismet server would respond with
an empty string, rather than "true" or "false", like it claims in the
1.1 API.  This seems to be a fairly recent development, as it hadn't
done this to me in the past.  I've worked around the problem by
treating the empty response as if it were "false" -- that is,
accepting the comment.


-- 
Michael Olson -- FSF Associate Member #652 -- http://www.mwolson.org/
Interests: Emacs Lisp, text markup, protocols -- Jabber: mwolson_at_hcoop.net
  /` |\ | | | Projects: Emacs, Muse, ERC, EMMS, Planner, ErBot, DVC
 |_] | \| |_| Reclaim your digital rights by eliminating DRM.
      See http://www.defectivebydesign.org/what_is_drm for details.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
pyblosxom-users mailing list
pyblosxom-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
signature.asc (application/pgp-signature, 188 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFV5ch+1Ho2POo0xkRApLZAKCLOlzEuI6lfPUTQyjg2eCNGWj9VgCfYkmM
tk9GFEMWFCISChhVXY69l9g=
=BjKh
-----END PGP SIGNATURE-----
akismetcomments.py.diff (text/x-patch, 329 B)
--- akismetcomments.py	2006-11-02 15:44:38.000000000 -0500
+++ akismetcomments.py	2006-11-12 16:38:53.000000000 -0500
@@ -77,7 +77,7 @@
     return True
 
 def cb_comment_reject(args):
-    from akismet import Akismet
+    from akismet import Akismet, AkismetError
 
     request = args['request']
     comment = args['comment']
akismet.py.diff (text/x-patch, 391 B)
--- akismet.py	2006-11-02 15:44:38.000000000 -0500
+++ akismet.py	2006-11-12 15:45:40.000000000 -0500
@@ -275,7 +275,7 @@
         resp = resp.lower()
         if resp == 'true':
             return True
-        elif resp == 'false':
+        elif resp == 'false' or resp == '':
             return False
         else:
             # NOTE: Happens when you get a 'howdy wilbur' response !
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.