<s> import datetime <EOL> import notification_utils <EOL> class RollChecker ( object ) : <EOL> def __init__ ( self , ** kwargs ) : <EOL> pass <EOL> def start ( self , archive ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def check ( self , archive ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class NeverRollChecker ( RollChecker ) : <EOL> def check ( self , archive ) : <EOL> return False <EOL> class TimeRollChecker ( RollChecker ) : <EOL> def __init__ ( self , ** kwargs ) : <EOL> super ( TimeRollChecker , self ) . __init__ ( ) <EOL> minutes = int ( kwargs . get ( '<STR_LIT>' , <NUM_LIT> ) ) <EOL> self . timedelta = datetime . timedelta ( minutes = minutes ) <EOL> def start ( self , archive ) : <EOL> self . start_time = notification_utils . now ( ) <EOL> self . end_time = self . start_time + self . timedelta <EOL> def check ( self , archive ) : <EOL> return notification_utils . now ( ) >= self . end_time <EOL> class SizeRollChecker ( RollChecker ) : <EOL> def __init__ ( self , ** kwargs ) : <EOL> super ( SizeRollChecker , self ) . __init__ ( ) <EOL> self . roll_size_mb = int ( kwargs . get ( '<STR_LIT>' , <NUM_LIT:1> ) ) <EOL> def check ( self , archive ) : <EOL> size = archive . get_file_handle ( ) . tell ( ) <EOL> return ( size / <NUM_LIT> ) >= self . roll_size_mb </s>
