示例#1
0
 def testsendattachmail(self):
     weather.sendattachmail('*****@*****.**',
                            '测试附件', '希望顺利')
示例#2
0
        filename = u'template/wea' + order + u'.xml'
        if filename in allwealist:
            nowlist = weather.xmlToList(filename)
            mess = ''.join((mess, u'\n\n系统采集正常,信息来源:', nowlist[0], u'\n'))
            mess = ''.join((mess, u'\n', u' '*4, nowlist[1]))
            tempstr = "| ".join((
                zhLjust(nowlist[2], 20), zhLjust(nowlist[3], 20),
                zhLjust(nowlist[5], 20), zhLjust(nowlist[4], 40),
            ))
            mess = ''.join((mess, u'\n', u' '*4, tempstr))
            tempstr = "| ".join((
                zhLjust(nowlist[6], 20), zhLjust(nowlist[7], 20),
                zhLjust(nowlist[8], 20),
            ))
            mess = ''.join((mess, u'\n', u' '*4, tempstr))
            tempstr = "| ".join((
                zhLjust(nowlist[9], 20),
                zhLjust(nowlist[10], 20), zhLjust(nowlist[11], 20)
            ))
            mess = ''.join((mess, u'\n', u' '*4, tempstr))
for order in ORDER:
    filename = u'template/wea' + order + u'.xml'
    if filename in allwealist:
        mess = ''.join((mess, u'\n\n', u'='*16,
                        u'\n\n系统采集正常,生成页面采用信息来源: ', filename))
        weather.xmlToHtml(filename)
        weather.sendattachmail('*****@*****.**',
                               u'天气预报运行报告',
                               mess.encode('utf-8'))
        break