Trackback plugin broke?

Eric Gaumer <gaumerel-rO34MGDSYikxZu/[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
I just installed pyblosxom a day or two ago. I was trying to get the
trackback plugin working last night but had nothing but grief.

It seems it's broken at the moment. I even went of to Ted's site and test
out his trackback links (http://www.sauria.com/blog/) but they too were
bad. 

There seems to be a stray "Status: 200" string pushed to STDOUT which jams
the XML parser.

Found this:

out.write("Status: %s\n" % self.status) 

in pyblosxom.py

Removing it doesn't seem to effect anything other than the fact that it
cure this trackback problem. On top of that I also found some problems in
the trackback.py plugin directly.  Patch follows:

--- ../data/CVS/pyblosxom/contrib/plugins/comments/plugins/trackback.py 2005-03-11 19:06:12.000000000 -0800
+++ trackback.py        2005-03-24 00:37:08.000000000 -0800
@@ -48,6 +48,7 @@
     """
     request = args['request']
     pyhttp = request.getHttp()
+    form = request.getForm()
     config = request.getConfiguration()

     urltrigger = config.get('trackback_urltrigger','/trackback')
@@ -57,9 +58,7 @@
         print "Content-type: text/xml"
         print

-        form = cgi.FieldStorage()
-
-        message = "not trackback"
+       message = "not trackback"
         if form.has_key("title") and form.has_key("excerpt") and \
                form.has_key("url") and form.has_key("blog_name"):
             import time
@@ -70,11 +69,11 @@
                       'source' : form['blog_name'].value, \
                       'description' : form['excerpt'].value }
             from Pyblosxom.entries.fileentry import FileEntry
-            from Pyblosxom.Request import Request
+            from Pyblosxom.pyblosxom import Request
             from Pyblosxom.pyblosxom import PyBlosxom

             datadir = config['datadir']
-
+
             from comments import writeComment
             try:
                 import os
@@ -85,7 +84,7 @@
                 entry = FileEntry(request, '%s.%s' % (path, ext), datadir )
                 data = {}
                 data['entry_list'] = [ entry ]
-                writeComment(request, config, data, cdict, config['blog_encoding'])
+                writeComment(request, config, data, cdict)
                 print tb_good_response
             except OSError:
                 message = 'URI '+path_info+" doesn't exist"

This is CVS code, checked out a day or two ago. I'm not that familiar with
pyblosxom but I suspect this plugin is using older calls/methods? Don't
really know but these fixes cure my problems.

	-Eric



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
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.