[Moin-user] Trying to understand notification behaviour in PageEdit.py

Paul Boddie paul at boddie.org.uk
Tue Mar 3 12:28:17 EST 2015


On Tuesday 3. March 2015 17.47.56 Philip Colmer wrote:
> Thanks, Paul, for your comments.
> 
> I've (finally) managed to find a way to get logging working on
> PageEditor.py and I've been able to confirm that notify is, indeed,
> set to False by my code.
> 
> Upon further thinking, I suspect that the notifications are *not*
> being caused by my script editing the various pages but, instead, by
> the fact that my script refreshes attachments on each of the pages.

Yes, I was going to suggest the attachments because the attachment mechanisms 
also cause events to be sent.

> The pages are profile pages for each employee and, as such, link to a
> photo of the employee. Since I don't have an easy way of checking
> whether or not the photo has changed, I just updated it every time the
> script runs. Since the attachment code causes notifications, I think
> that is the root cause.

I would think so, too.

> So I've either got to figure out a clean way of extending the
> attachment code so that notifications can be disabled in code, like
> PageEditor allows, or find a better way to handle the photos so that I
> don't have to keep on refreshing the attachments.

It would certainly be nicer to be able to suppress notifications in the 
attachment API, but that would involve enhancing Moin, and I don't really know 
what the situation is with regard to getting patches into upstream Moin 1.x 
these days.

An alternative might involve accessing the stored attachments and comparing a 
checksum of the content with the thing you're considering attaching.

Paul




More information about the Moin-user mailing list