コード例 #1
0
ファイル: utils.py プロジェクト: Gavin-McCormick/watttime
def repeat_task(date, command, interval):
    if interval < 30:
        raise ValueError('No repeats shorter than 30 seconds')

    t = ScheduledTasks()
    t.date = date
    t.command = command
    t.repeat = True
    t.repeat_interval = interval
コード例 #2
0
ファイル: utils.py プロジェクト: Gavin-McCormick/watttime
def schedule_task(date, command):
    t = ScheduledTasks()
    t.date = date
    t.command = command
    t.repeat = False
    t.save()