Jason Tackaberry wrote: > On 2007-10-25 08:55, Hans Meine wrote: >> I also prefer kwargs. However, I wondered about your double (()), and >> I agree >> with Jason that a single timer per object simplifies things. > > I dislike the differentiation between, as in Duncan's example, min and > mins kwarg. I'm never going to remember what's what. > > The idea was mins allows an interval, whereas min was a fixed time. An > interval is just a shorthand way of specifying a list of possible values > for min. So how about we just let the kwargs accept sequences or range > objects. > > t.schedule(min = 0) # on the hour every hour > t.schedule(min = range(0, 60, 50)) # every 5 minutes > t.schedule(hour = [0, 12], min = 30) # at half past midnight and noon > > Calling it AtTimer would be fine with me.
Look right to me. So we agreed on the interface and the name. Anyone
coding it? ;)
| class AtTimer(Callback)
| def schedule(hour=range(24), min=range(60), sec=0):
| ...
| def stop()
| ...
Callback return False and it will be removed, just like Timer. And we
may want to have:
| class OneShotAtTimer(AtTimer):
| def __call__(self, *args, **kwargs):
| super(OneShotAtTimer).__call__(*args, **kwargs)
| return False
and the weak stuff:
| class WeakAtTimer
| class WeakOneShotAtTimer
Dischi
--
Real Men don't make backups. They upload it via ftp and let the world
mirror it.
-- Linus Torvalds
pgp9FwUNubuZl.pgp
Description: PGP signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ Freevo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-devel
