(self, frequency, maximum, start=0)
Translate frequency into comma separated times.
Translate frequency into comma separated times.
Translate frequency into comma separated times .
def produce_frequency_time(self, frequency, maximum, start=0):
        """Translate frequency into comma separated times.
        """
        # how many units one time type have
        length = maximum - start + 1
        # if every is the same with unit length
        if frequency == length:
            return str(start)
        # else if every is one unit, we use '*'
        elif frequency == 1:
            return '*'
        # otherwise, we make steps comma separated
        else:
            times = list(range(start, maximum + 1, frequency))
            if length % frequency:
                del times[0]
            times = map(str, times)
            return ','.join(times)
def produce_frequency_time ( self , frequency , maximum , start = 0 ) : # how many units one time type have length = maximum - start + 1 # if every is the same with unit length if frequency == length : return str ( start ) # else if every is one unit, we use '*' elif frequency == 1 : return '*' # otherwise, we make steps comma separated else : times = list ( range ( start , maximum + 1 , frequency ) ) if length % frequency : del times [ 0 ] times = map ( str , times ) return ',' . join ( times )