Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following show alternative example that produce produces the same definition:


Code Block
languagepy
start = TimeSlot(0, 0)
finish = TimeSlot(23, 0)
incr = TimeSlot(0, 30)
time_series = TimeSeries(start, finish, incr, True)
        
cron = Cron()
cron.set_week_days( [0,1,2,3,4,5,6] )
cron.set_days_of_month( [1,2,3,4,5,6] )
cron.set_months( [1,2,3,4,5,6] )
cron.set_time_series( "+00:00 23:00 00:30" )

defs = Defs().add(
        Suite("s1").add(
         Task("date").add(
           Date(1, 0, 0),
           Date("2.*.*"),
           Date(28,2,2026)),
         Task("day").add(
           Day("monday"),
           Day(Days.tuesday)),
         Task("time").add(
           Time("+00:30"),
           Time("+00:30 20:00 01:00"),
           Time(0, 59, True),
           Time(TimeSlot(20, 10)),
           Time(TimeSlot(20, 20), True),
           Time(time_series),
           Time(0, 10),
           Time("+00:40"),
           Time("+00:40 20:00 01:00")),
         Task("cron").add(cron)))



Code Block
languagepy
start = TimeSlot(0, 0)
finish = TimeSlot(23, 0)
incr = TimeSlot(0, 30)
time_series = TimeSeries(start, finish, incr, True)

defs = Defs() + ( Suite("s1") + Task("date") + Task("day") + Task("time") + Task("cron"))
defs.s1.date += [ Date(1, 0, 0), Date("2.*.*"),  Date(28,2,2026) ]
defs.s1.day +=  [ Day("monday"), Day(Days.tuesday) ]
defs.s1.time += [ Time("+00:30"), Time("+00:30 20:00 01:00"), Time(0, 59, True),
                  Time(TimeSlot(20, 10)), Time(TimeSlot(20, 20), True),
                  Time(time_series), Time(0, 10), Time("+00:40"),
                  Time("+00:40 20:00 01:00") ]
defs.s1.cron += Cron("+00:00 23:00 00:30",
                     days_of_week=[0,1,2,3,4,5,6],
                     days_of_month=[1,2,3,4,5,6],
                     months=[1,2,3,4,5,6])


...