+ next_playing(c)
+ print " disabling random play"
+ c.random_disable()
+ wait_idle(c)
+ print " scheduling track to play later via command line"
+ when = now() + 3
+ dtest.command(["disorder",
+ "--config", disorder._configfile,
+ "--no-per-user-config",
+ "schedule-play",
+ time.strftime("%Y-%m-%d %H:%M:%S",
+ time.localtime(when)),
+ "normal",
+ track])
+ print " disorder schedule-list output:"
+ print string.join(dtest.command(["disorder",
+ "--config", disorder._configfile,
+ "--no-per-user-config",
+ "schedule-list"]), ""),
+ p = next_playing(c)
+ assert p["track"] == track, "checking right track played"
+ assert p["when"] >= when, "checking track played at right time"
+ assert c.schedule_list() == [], "checking schedule is empty"
+ wait_idle(c)
+ print " scheduling an enable-random for later via command line"
+ dtest.command(["disorder",
+ "--config", disorder._configfile,
+ "--no-per-user-config",
+ "schedule-set-global",
+ time.strftime("%Y-%m-%d %H:%M:%S",
+ time.localtime(now() + 3)),
+ "normal",
+ "random-play",
+ "yes"])
+ print " disorder schedule-list output:"
+ print string.join(dtest.command(["disorder",
+ "--config", disorder._configfile,
+ "--no-per-user-config",
+ "schedule-list"]), ""),
+ p = next_playing(c)
+ print " disabling random play"
+ c.random_disable()
+ print " waiting for nothing to be playing"
+ while c.playing() is not None:
+ time.sleep(1)
+ print " ."
+ print " scheduling a track for the future"
+ c.schedule_add(now() + 3, "normal", "play", track)
+ print " schedule via python:"
+ s = c.schedule_list()
+ for event in s:
+ e = c.schedule_get(event)
+ print "item %s: %s" % (event, e)
+ print " deleting item %s" % s[0]
+ c.schedule_del(s[0])
+ print " checking it's really gone"
+ s = c.schedule_list()
+ assert s == [], "checking schedule is empty"