Hi !
Le mardi 22 décembre 2009 16:03:57, Upp, William a écrit :
> ({date("20/22/2009")}, christmas), <--I added this
> ({date_match("02/26/2009")}, myplaylist),<--I added this
>
> myplaylist])
> -------------------------------
> So far, when I add this to my existing script, and start liquidsoap, I get
> an error. If I take it out, it runs as normal. And, I did create the
> christmas item with a playlist associated with it.
Apparently, the dates in the script language such as 1w and 19h-20h are only
meant to describe a relative data.
However, you can define any condition function in the switch parameter.
Hence, you can use any script in any language you like to test the date.
Imagine that the script/command "/usr/bin/test_date $DATE" returns "1" when
the date is correct. Then you can write:
# A generic function string -> unit -> bool to test a date
def test_date(date)
fun () -> list.hd(get_process_lines("/usr/bin/test_date #{date}")) == "1"
end
(...)
(test_date("20/22/2009"), christmas),
(test_date("02/26/2009"), myplaylist),
myplaylist])
In this code, test_date("20/22/2009") is a function that takes no argument and
returns true when the script returns 1. You should be able to use this with a
script/command that tests your date..
Romain
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users