[Zope] Polling a folder

GimsMail elabuschagne@gims.com
Tue, 3 Sep 2002 17:13:50 +0200


Hi all,

What's the best way to Poll a folder in Zope (I want to check the folder
every now and again for new items, perform some actions, etc.)

I have tried creating a polling object that runs a loop in a thread and does
the work I want it to do. I do this with a Zope Object inheriting from
SimpleItem.SimpleItem.  I invoke this object's run method in a thread with
thread.start_new_thread(self.run,()).  Zope doesn't seem too happy if I
inherit from SimpleItem.SimpleItem and threading.Thread at the same time!

The strange thing is I get acquisition problems that I'm battling to solve.

Things like:
self.aq_parent.Tables.id == 'Tables'
self.aq_parent.Tables.QMessages.id == 'Tables' (??? Seems like QMessages is
the same object as Tables)
self.aq_parent.Tables.QMessages.sqlGet() == Attribute Error (it claims
sqlGet does not exist, it does).

Also, when using the ZMI to navigate to the offending folder (to see if the
folders are there etc.) then the acquisition will suddenly start working
again.

I'm not sure if the fact that I'm polling in a thread has got anything to do
with my problems, but I am sure that I'm sooooo confused!

Etienne

P.S. I'm currently battling Outlook to get it to send Plain Text mails, so
please bear with me if this is in HTML!