src/cron/cron_manager.py
def add_or_update_job(self, minute, hour, day, month, weekday, command):
        """
        Method for adding jobs. If the job is already added,
        the schedule for this job will be updated.
        """
        if not (minute == '*' or 0 <= int(minute) <= 59):
            raise Exception("Minute out of range")
        if not (hour == '*' or 0 <= int(hour) <= 23):
            raise Exception("Hour out of range")
        if not (day == '*' or 1 <= int(day) <= 31):
            raise Exception("Day out of range")
        if not (month == '*' or 1 <= int(month) <= 12):
            raise Exception("Month out of range")
        if not (weekday == '*' or 0 <= int(weekday) <= 6):
            raise Exception("Weekday out of range")

        # Check if the job already exists, if yes then remove.
        for job in self.jobList:
            if job['command'] == command:
                self.jobList.remove(job)

        # Add new job to list
        job = {'minute': minute, 'hour': hour, 'day': day, \
        'month': month, 'weekday': weekday, 'command': command}

        self.jobList.append(job)

        Method for adding jobs. If the job is already added,
        the schedule for this job will be updated.
        
Method for adding jobs. If the job is already added,
the schedule for this job will be updated.
Method for adding jobs . If the job is already added the schedule for this job will be updated .
def add_or_update_job(self, minute, hour, day, month, weekday, command):
        if not (minute == '*' or 0 <= int(minute) <= 59):
            raise Exception("Minute out of range")
        if not (hour == '*' or 0 <= int(hour) <= 23):
            raise Exception("Hour out of range")
        if not (day == '*' or 1 <= int(day) <= 31):
            raise Exception("Day out of range")
        if not (month == '*' or 1 <= int(month) <= 12):
            raise Exception("Month out of range")
        if not (weekday == '*' or 0 <= int(weekday) <= 6):
            raise Exception("Weekday out of range")
        for job in self.jobList:
            if job['command'] == command:
                self.jobList.remove(job)
        job = {'minute': minute, 'hour': hour, 'day': day, \
        'month': month, 'weekday': weekday, 'command': command}
        self.jobList.append(job)
def add_or_update_job ( self , minute , hour , day , month , weekday , command ) : if not ( minute == '*' or 0 <= int ( minute ) <= 59 ) : raise Exception ( "Minute out of range" ) if not ( hour == '*' or 0 <= int ( hour ) <= 23 ) : raise Exception ( "Hour out of range" ) if not ( day == '*' or 1 <= int ( day ) <= 31 ) : raise Exception ( "Day out of range" ) if not ( month == '*' or 1 <= int ( month ) <= 12 ) : raise Exception ( "Month out of range" ) if not ( weekday == '*' or 0 <= int ( weekday ) <= 6 ) : raise Exception ( "Weekday out of range" ) for job in self . jobList : if job [ 'command' ] == command : self . jobList . remove ( job ) job = { 'minute' : minute , 'hour' : hour , 'day' : day , 'month' : month , 'weekday' : weekday , 'command' : command } self . jobList . append ( job )
Method for adding jobs.
Method for adding jobs .
"""
        Method for adding jobs. If the job is already added,
        the schedule for this job will be updated.
        """ # Check if the job already exists, if yes then remove.
 # Add new job to list

self
minute
hour
day
month
weekday
command