#NEWLINE# def periodic_task( self , validate_datetime , name = None ) : #NEWLINE# #INDENT# '\n        Decorator to execute a function on a specific schedule.\n        ' #NEWLINE# def decorator( func ) : #NEWLINE# #INDENT# def method_validate( self , dt ) : #NEWLINE# #INDENT# return validate_datetime ( dt ) #NEWLINE# #UNINDENT# klass = create_task ( PeriodicQueueTask , func , task_name = name , validate_datetime = method_validate ) #NEWLINE# func . task_class = klass #NEWLINE# def _revoke( revoke_until = None , revoke_once = False ) : #NEWLINE# #INDENT# self . revoke ( klass ( ) , revoke_until , revoke_once ) #NEWLINE# #UNINDENT# func . revoke = _revoke #NEWLINE# def _is_revoked( dt = None , peek = True ) : #NEWLINE# #INDENT# return self . is_revoked ( klass ( ) , dt , peek ) #NEWLINE# #UNINDENT# func . is_revoked = _is_revoked #NEWLINE# def _restore( ) : #NEWLINE# #INDENT# return self . restore ( klass ( ) ) #NEWLINE# #UNINDENT# func . restore = _restore #NEWLINE# return func #NEWLINE# #UNINDENT# return name