def generateQQMeetingNotice(): text = u'大家好,组会定于下周二上午9:30召开,沈老师会出席,本周轮到' for name in user_list.keys(): info = user_list[name] if info['type'] == week_time.getWeekNo() % 2: text = text + u'@' + info['name'] text += u'做个人科研进展&思路汇报。每人把汇报概要在项目组官网填好(邮件里用,截止到周日晚22:00),网址:%s' % meeting_report_page # text += u',本周轮到@' + getRecordPerson() + u'做会议记录,组会结束后两天内提交至:\\\\osvt.net\\osv\\Audit\\每周会议记录\\OSVT-%s年%s学期会议记录' % (cur_year, cur_semester) print 'Meeting Notice:\n' + text return text
def generateQQMeetingNotice(): text = u'大家好,组会定于下周二上午9:30召开,沈老师会出席,本周轮到' for name in user_list.keys(): info = user_list[name] if info['type'] == week_time.getWeekNo() % 2: text = text + u'@' + info['name'] text = text + u'做个人科研进展&思路汇报。每人把汇报概要在项目组官网填好(邮件里用,截止到周日晚22:00),网址:http://osvt.net:9000/p/meeting' text = text + u',本周轮到@' + getRecordPerson() + u'做会议记录,组会结束后两天内提交至:\\\\osvt.net\\osv\\Audit\\每周会议记录\\OSVT-16年春季学期会议记录' print 'Meeting Notice:\n' + text return text
def generateMailTitleAndContent(): close = u''' -- 致 礼! [email protected] 操作系统与虚拟化项目组 北京大学软件与微电子学院 ''' title = '【操作系统与虚拟化组2016年秋季学期第%d周组会】通知与内容预告' % (week_time.getWeekNo() + 1) content = database.getMeetingInfo() + close return (title, content)
def check_meeting_record(): res = False search_str = u'第%d周会议记录' % (week_time.getWeekNo()) filename_list = getFileList() print 'Meeting records:' for filename in filename_list: print filename if filename.find(search_str) != -1: res = True print 'Need to find: ' + search_str if res: print 'Already Found!' else: print 'Not Found!' return res
def generateMailTitleAndContent(): close = u''' -- 致 礼! [email protected] %s 北京大学软件与微电子学院 ''' % group_name.decode('gbk') title = '【%s20%s年%s学期第%d周组会】内容通知与预告' % (group_name, cur_year, cur_semester, week_time.getWeekNo() + 1) content = database.getMeetingInfo() + close return title, content
def getLastRecordPerson(): return record_list[(week_time.getWeekNo() - 1) % len(record_list)]
def getRecordPerson(): return record_list[week_time.getWeekNo() % len(record_list)]
if samba.check_meeting_record() == False: report = generateQQRecordReport() qq.QQ_SendTextWithAt(report) def task_SendNextMeetingMails(): performEvaluation() (title, content) = generateMailTitleAndContent() content = addMeetingRemarksToMail(content) content = addRecordRemarkToMail(content) print 'Title:\n' + title print 'Content:\n' + content mail.mail_sendMails(title, content) if __name__ == '__main__': # task_SendQQMeetingNotice() # task_RetrieveWebsiteAndSendQQReport() # task_SendNextMeetingMails() print week_time.getWeekNo() print getLastRecordPerson() text = '' for name in user_list.keys(): info = user_list[name] if info['type'] == week_time.getWeekNo() % 2: text = text + u'@' + info['name'] print text # task_SendQQRecordNotice() # task_RetrieveRecordAndSendQQReport()
server.login(mail_address, mail_pass) server.sendmail(me, receive_list + copy_list, msg.as_string()) server.quit() return True except Exception, e: print str(e) return False def mail_sendMails(title, content): send_mails(mail_credential, receive_list, copy_list, title, content) # send_mail(mail_credential, receive_list, copy_list, "Title", "hello world!") if __name__ == '__main__': week_no = week_time.getWeekNo() + 1 group_name = "测试组" cur_year = '16' cur_semester = '秋季' title = '【%s20%s年%s学期第%d周组会】通知与内容预告' % (group_name, cur_year, cur_semester, week_no) content = '''各位老师、同学好: 本组第%d周组会于下周二(后天)上午9:30召开,地点中科院实验室291,所有组员进行个人工作的PPT汇报,每人不超过20分钟。 XX:1)完成AsiaCCS'16投稿;2)推进patron的工程进展。 XX:**没有按时写,下次注意** XX:**没有按时写,下次注意** XX:ra进展 XX:没有太多要讲,上周期中大作业和1/2的专题 XX:OpenStack消息通信机制 XX:**没有按时写,下次注意**