#NEWLINE# def get_next_value( self , date , field ) : #NEWLINE# #INDENT# start = field . get_value ( date ) #NEWLINE# minval = field . get_min ( date ) #NEWLINE# maxval = field . get_max ( date ) #NEWLINE# minval = min ( maxval , max ( minval , self . first ) ) #NEWLINE# if ( self . last is not None ) : #NEWLINE# #INDENT# maxval = min ( maxval , self . last ) #NEWLINE# #UNINDENT# start = max ( start , minval ) #NEWLINE# if ( not self . step ) : #NEWLINE# #INDENT# next = start #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# distance_to_next = ( ( self . step - ( start - minval ) ) % self . step ) #NEWLINE# next = ( start + distance_to_next ) #NEWLINE# #UNINDENT# if ( next <= maxval ) : #NEWLINE# #INDENT# return next #NEWLINE# #UNINDENT# def __eq__( self , other ) : #NEWLINE# #INDENT# return ( isinstance ( other , self . __class__ ) and ( self . first == other . first ) and ( self . last == other . last ) )