Re: plug-in entrycache

"Will Guaraldi" <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
It took me a while to figure out the issue, but I think I've got it.
We fixed the filestat callback such that we only do an os.stat if none
of the plugins have given us a valid mtime.

The problem here is that entrycache looks at the mtime from the
callback to cache it.  But PyBlosxom no longer does the os.stat before
calling the filestat callback, so the mtime during the callback is 0
by the time the plugin has kicked in.

I think the plugin needs to be reworked to pick up the mtime of the
files it doesn't have mtimes for _after_ the mtime has been
calculated.

It looks like the documentation on the filestat callback is confusing.
 The purpose is to allow plugins to provide an mtime without us having
to do an os.stat on the file.  However, it says the provided mtime is
the result of an os.stat--it shouldn't be; that's something we fixed
with 1.4.

If you need me to re-work the plugin, I can.  It'll take a while to
get to, though.

/will


On 8/26/07, Pablo / Silvasonic <[email protected]> wrote:
> Is anybody using the entrycache plug-in in their installation? I've
> run into the problem described below:
>
> the plug-in seems to be installed correctly. it creates the log file
> itself and it writes the entries to it the first time it encounters
> them, but i get something like:
>
> file: datadir/.entrycache
>
> {
>
> '/path/to/my/datadir/this-is-an-entry-for-my-blog.txt' : 0,
>
> }
>
> with no date info recorded (the 0, i assume, should be something like
> 200708242400, right?)
>
> if i touch the entry, it floats back to the top (because the mtime changes too)
>
> I've exchanged a couple of w-mail with the plug-in author (thanks
> Joe!) and here's what he said:
>
> OK, well since the file is being updated, it's not a permissions issue.
>
> Do you know how to work with Python at all? I'm wondering if it's the
>
> f.write("\t'%s' : %i,\n" % (args['filename'], args['mtime'][8]))
>
> line causing the issue. Maybe something has changed where
> args['mtime'][8] is now not the correct array element...

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
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.