<s> import smtplib <EOL> from email . mime . text import MIMEText <EOL> import socket <EOL> from . parser import load_task_graph <EOL> def notify ( * contact_list ) : <EOL> """<STR_LIT>""" <EOL> task_graph = load_task_graph ( ) <EOL> status = '<STR_LIT>' <EOL> if task_graph . successful : <EOL> status = '<STR_LIT>' <EOL> n_lines = <NUM_LIT:100> <EOL> with open ( task_graph . abs_log_path , '<STR_LIT:r>' ) as stream : <EOL> text = "<STR_LIT>" % ( <EOL> n_lines , task_graph . abs_log_path <EOL> ) <EOL> text += '<STR_LIT:">' * <NUM_LIT> + "<STR_LIT>" <EOL> text += '<STR_LIT:\n>' . join ( stream . readlines ( ) [ - <NUM_LIT:100> : ] ) <EOL> msg = MIMEText ( text ) <EOL> msg [ '<STR_LIT>' ] = "<STR_LIT>" % ( status , socket . gethostname ( ) , ) <EOL> msg [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> msg [ '<STR_LIT>' ] = '<STR_LIT:U+002CU+0020>' . join ( contact_list ) <EOL> server = smtplib . SMTP ( '<STR_LIT:localhost>' ) <EOL> server . sendmail ( msg [ '<STR_LIT>' ] , contact_list , msg . as_string ( ) ) <EOL> server . quit ( ) </s>
