def changeJobExecutionDay(job): if job.executionType == "weekly": dayOptions = {} for (x, day) in enumerate(job_weekdays, 1): dayOptions[str(x)] = {"name": day, "function": setJobExecutionDay, "arg": [job, job.setExecutionDay, day]} dayOptions["x"] = {"name": "exit menu", "function": jobProperties, "arg": [job]} makeMenu(dayOptions) else: new_day = None while not new_day: new_day_str = raw_input("New execution day (1 to 30): ") try: new_day = int(new_day_str) if new_day < 1 or new_day > 30: new_day = None print "Invalid day please enter a number between 1 and 30." except: new_day = None print "Invalid day please enter a number between 1 and 30." job.setExecutionDay(new_day) jobs_handler.saveJobs(jobs) jobProperties(job)
def changeJobExecutionTime(job): new_time = None while not new_time: new_time_str = raw_input("New Execution Time: ") try: new_time = util.parseTime(new_time_str) except: new_time = None print "Invalid time formate please write HH:MM" job.setExecutionTime(new_time) jobs_handler.saveJobs(jobs) jobProperties(job)
def setJobExecutionDay(job, function, day): function(day) jobs_handler.saveJobs(jobs) jobProperties(job)
def setJobInterval(job, function, interval): function(interval) jobs_handler.saveJobs(jobs) jobProperties(job)