ingoogni gmail.com wrote:
> Robert Brewer wrote:
>
> > Dejavu includes that module, but it's designed
and distributed as a
> > standalone. See http://proje
cts.amor.org/misc/wiki/Recur
>
> Off topic for Cherrypy, but related to the subject,
>
> Is there a simple sample somewhere that shows a not so
> confident Python
> user, like me, how to use the recur module?
>
> I'd like to use it to make time lapse movies. For
example, take an
> image every 30 minutes between 7.00 and 17.00 on each
> work-day and none in the weekend.
Wow, that's complicated! ;) The recur module doesn't do
compound
schedules; you'd have to combine those three requirements
yourself,
either with nested workers, or with a single worker that
just ignores
invalid datetimes. For example, I'd probably write:
class MovieWorker(recur.Worker):
def work(self):
if (self.nextrun.day not in (5, 6)
and (7 < self.nextrun.hour < 17)):
take_frame()
mw = MovieWorker("30 minutes")
You could also pass the (5, 6) and (7, 17) bounds as
arguments to the
worker, if you needed that flexibility. Normal Python rules
still apply.
;)
Robert Brewer
System Architect
Amor Ministries
fumanchu amor.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|