[Zope] Writing a python script

Laura McCord Laura.McCord at doucet-austin.com
Fri May 14 10:39:55 EDT 2004


This is my first time writing a python script.

So, I need a little help getting kick started.

In a folder called Test I have three PloneExternalFiles much like the
Zope version of ExtFile. I am writing a python script to delete those
files that are over 5 days old. I am trying to start small so for right
now I don't want to worry about a scheduler, I just want to get started
writing the script. I have some pseudocode that I have written and I am
slowly tranferring it to the python script.

So for example I want to pass the ploneexternalfile id's to the python
script. So would I just put ## parameters=id ?

Additionally, how would I compare the system date to the modification
date of the file? 
       I know in the PloneExternalFile.py they use getFileModDate method
would I use this or do I need something else 

while id:
      mod_date = ? 
      sys_date = ?
           cmp(mod_date, sys_date)
           if mod_date > 5
             ?.manage_delObjects(id)

Any ideas would help me. I have been stuck on this too long.

Thanks.



More information about the Zope mailing list