Missing the : at the end of the line (before the comment).
On Monday, October 17, 2011 11:15:31 AM UTC-4, annet wrote:
>
> I adjusted the expire_sessions.py file.
>
> EXPIRATION_MINUTES=60
> DIGITS=('0','1','2','3','4','5','6','7','8','9')
> import os, time, stat, logging
> for app in ['admin','init'] # add your apps
> path=os.path.join(request.folder,'sessions')
> if not os.path.exists(path):
> os.mkdir(path)
> now=time.time()
> for filename in os.listdir(path):
> fullpath=os.path.join(path,filename)
> try:
> if os.path.isfile(fullpath):
> t=os.stat(fullpath)[stat.ST_MTIME]
> if now-t>EXPIRATION_MINUTES*60 and
> filename.startswith(DIGITS):
> try:
> os.unlink(fullpath)
> except Exception,e:
> logging.warn('failure to unlink %s: %s' %
> (fullpath,e))
> except Exception, e:
> logging.warn('failure to stat %s: %s' % (fullpath,e))
>
>
> Apparently there is a syntax error:
>
> File "applications/admin/cron/expire_sessions.py", line 4
> for app in ['admin','init'] # add your apps
> ^
> SyntaxError: invalid syntax
>
>
> but I don't see what's wrong.
>
>
> Kind regards,
>
> Annet.