<s> from datetime import timedelta <EOL> from gluon import * <EOL> class Daily ( ) : <EOL> """<STR_LIT>""" <EOL> def __call__ ( self ) : <EOL> db = current . db <EOL> request = current . request <EOL> settings = current . deployment_settings <EOL> appname = request . application <EOL> base_url = settings . get_base_public_url ( ) <EOL> now = request . utcnow <EOL> reply_to = settings . get_mail_sender ( ) <EOL> send_email = current . msg . send_email <EOL> table = current . s3db . project_project <EOL> subject = "<STR_LIT>" <EOL> message = "<STR_LIT>" % ( base_url , appname ) <EOL> query = ( table . end_date == now . date ( ) ) <EOL> rows = db ( query ) . select ( table . id , <EOL> table . name , <EOL> table . created_by ) <EOL> for row in rows : <EOL> send_email ( to = row . created_by , <EOL> subject = subject % row . name , <EOL> message = message + row . id , <EOL> reply_to = reply_to <EOL> ) <EOL> subject = "<STR_LIT>" <EOL> message = "<STR_LIT>" % ( base_url , appname ) <EOL> stale = now - timedelta ( weeks = <NUM_LIT> ) <EOL> query = ( table . status != <NUM_LIT:2> ) & ( table . modified_on . year ( ) == now . year ) & ( table . modified_on . month ( ) == now . month ) & ( table . modified_on . day ( ) == now . day ) <EOL> rows = db ( query ) . select ( table . id , <EOL> table . name , <EOL> table . created_by ) <EOL> for row in rows : <EOL> send_email ( to = row . created_by , <EOL> subject = subject % row . name , <EOL> message = message + row . id , <EOL> reply_to = reply_to <EOL> ) <EOL> result = "<STR_LIT>" <EOL> return result </s>
