def nextDayTasks(rT):
    rT.setCount()
    targetDate = (datetime.datetime(2018,04,03) + timedelta(days=29))
    nextDueDate = (targetDate +  timedelta(minutes=rT.freq))
    tempCount = adjCount(rT)
    while (tempCount > 0):
        taskNew = Task(rT.taskName, rT.startDate, rT.endDate, rT.freqType, rT.freq, rT.count)
        if ((nextDueDate > (targetDate + timedelta(days=1))) or (nextDueDate > rT.endDate)):
            tempCount = 0
        else:
            taskNew.startDate = nextDueDate
            nextDueDate += timedelta(minutes=rT.freq)
            tempCount -= 1
            rT.count -= 1
            taskNew.count = rT.count
            tNStr = taskNew.display()
            #print tNStr
            outfile.write((str(tNStr))+"\n")
示例#2
0
def nextDayTasks(rT):
    rT.setCount()
    today = datetime.datetime.today()
    current = datetime.datetime(today.year, today.month, today.day)
    targetDate = (current + timedelta(days=29))
    nextDueDate = (targetDate + timedelta(hours=rT.freq))
    tempCount = adjCount(rT)
    while (tempCount > 0):
        taskNew = Task(rT.taskName, rT.startDate, rT.endDate, rT.freqType,
                       rT.freq, rT.count)
        if ((nextDueDate > (targetDate + timedelta(days=1)))
                or (nextDueDate > rT.endDate)):
            tempCount = 0
        else:
            taskNew.startDate = nextDueDate
            nextDueDate += timedelta(hours=rT.freq)
            tempCount -= 1
            rT.count -= 1
            taskNew.count = rT.count
            tNStr = taskNew.display()
            outfile.write((str(tNStr)) + "\n")
def nextDayTasks(rT):
    rT.setCount()
    today = datetime.datetime.today()
    current = datetime.datetime(today.year, today.month, today.day,
                                rT.startDate.hour)
    targetDate = current + relativedelta(months=+1)
    nextDueDate = (targetDate)
    if ((rT.startDate + relativedelta(months=+1)) == targetDate):
        tempCount = 1
    else:
        tempCount = 0
    while (tempCount > 0):
        taskNew = Task(rT.taskName, rT.startDate, rT.endDate, rT.freqType,
                       rT.freq, rT.count)
        taskNew.startDate = nextDueDate
        nextDueDate += relativedelta(months=+1)
        tempCount -= 1
        rT.count -= 1
        taskNew.count = rT.count
        tNStr = taskNew.display()
        #print tNStr
        outfile.write((str(tNStr)) + "\n")
示例#4
0
def nextDayTasks(rT):
    rT.setCount()
    today = datetime.datetime.today()
    current = datetime.datetime(today.year, today.month, today.day,
                                rT.startDate.hour)
    targetDate = (current + timedelta(days=29))
    nextDueDate = (targetDate)
    dateDiff = nextDueDate - rT.startDate
    print dateDiff
    if (dateDiff.days % 7) == 0:
        tempCount = 1
    else:
        tempCount = 0
    while (tempCount > 0):
        taskNew = Task(rT.taskName, rT.startDate, rT.endDate, rT.freqType,
                       rT.freq, rT.count)
        taskNew.startDate = nextDueDate
        nextDueDate += timedelta(days=rT.freq)
        tempCount -= 1
        rT.count -= 1
        taskNew.count = rT.count
        tNStr = taskNew.display()
        outfile.write((str(tNStr)) + "\n")