diff options
author | Holger Freyther <zecke@selfish.org> | 2005-07-26 14:41:44 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-07-26 14:41:44 +0000 |
commit | 13e06f356fb0c427c1e0007fbf2cf7ea4243b2fa (patch) | |
tree | bc7875edf80fdaa0f5257a09a7408b6d41cbd497 /classes | |
parent | a6c91177794c4e1657e2bb9b53a6b2cd0cda1d01 (diff) |
openembedded/classes/tinderclient.bbclass:
-Prepare the way for HTTP post
Diffstat (limited to 'classes')
-rw-r--r-- | classes/tinderclient.bbclass | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/classes/tinderclient.bbclass b/classes/tinderclient.bbclass index 595b51ef47..c55b380277 100644 --- a/classes/tinderclient.bbclass +++ b/classes/tinderclient.bbclass @@ -2,6 +2,23 @@ def tinder_tinder_time(): import time return time.strftime('%m/%d/%Y %H:%M:%S', time.localtime()) +def tinder_send_email(data, header, log): + import smtplib + from email.MIMEText import MIMEText + msg = MIMEText(header +'\n' + log) + msg['Subject'] = data.getVar('TINDER_SUBJECT',event.data, True) or "Tinder-Client build log" + msg['To'] = data.getVar('TINDER_MAILTO',event.data, True) + msg['From'] = data.getVar('TINDER_FROM', event.data, True) + + + s = smtplib.SMTP() + s.connect() + s.sendmail(data.getVar('TINDER_FROM', event.data, True), [data.getVar('TINDER_MAILTO', event.data, True)], msg.as_string()) + s.close() + +def tinder_send_http(data, header, log): + pass + # Prepare tinderbox mail header def tinder_prepare_mail_header(data, status): import bb @@ -92,18 +109,12 @@ def tinder_do_tinder_report(event): if len(log) == 0 or len(header) == 0: return - import smtplib - from email.MIMEText import MIMEText - msg = MIMEText(header +'\n' + log) - msg['Subject'] = data.getVar('TINDER_SUBJECT',event.data, True) or "Tinder-Client build log" - msg['To'] = data.getVar('TINDER_MAILTO',event.data, True) - msg['From'] = data.getVar('TINDER_FROM', event.data, True) + log_post_method = tinder_send_email + if bb.data.getVar('TINDER_SENDLOG', event.data, True) == "http": + log_post_method = tinder_send_http + log_post_method(event.data, header, log) - s = smtplib.SMTP() - s.connect() - s.sendmail(data.getVar('TINDER_FROM', event.data, True), [data.getVar('TINDER_MAILTO', event.data, True)], msg.as_string()) - s.close() addhandler tinderclient_eventhandler python tinderclient_eventhandler() { |