Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def send_mail_report(job, result, manager):
    backup_status, status, attachments=result
    if (job['mail']==False or (job['mail']=='fail' and status=='OK')) and not job['magikmon']:
        return None

    msg_body=job['msg_header']+'\n'+status
    subject='MKSBACKUP BACKUP %s %s' % (backup_status, job['name'])
    
    attachments.extend(manager.attachments)
    attachments.append(('status.txt', None, status.encode('utf-8'), 'text', 'plain', 'utf-8'))
    log_output=manager.stop_logging()
    attachments.append(('logging.txt', None, log_output.encode('utf-8'), 'text', 'plain', 'utf-8'))                       
    
    for line in status.split('\r\n'):
        if line:
           manager.log.info('    %s', line)
    
    return sendmail(job, subject, msg_body, attachments, manager.log, backup_status)
        


src/m/k/mksbackup-1.0.4/mksbackuplib/main.py   mksbackup(Download)
from datetime import datetime, timedelta
 
from archiver import boolean, check_mail_config, Destinations, sendmail, Manager, send_mail_report, write_status, ftp_url_re
 
import cron
                    write_status(result[1], cmd_options.statusdir, job['name'])
 
                errmsg=send_mail_report(job, result, manager)