[Zope] Re: Writing a python script
jkocherhans at mac.com
Fri May 14 11:27:50 EDT 2004
Check the os and os.path module.
Laura McCord wrote:
> 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
> Any ideas would help me. I have been stuck on this too long.
> Zope maillist - Zope at zope.org
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-dev )
More information about the Zope