Beispiel #1
0
    def compose_and_send_team_gmail(self, subject):  #, ga):
        """ga is a gmail account instance from libgmail that has
        already been logged into."""
        assert hasattr(self, 'pdfpath'), \
               'pres_rst_parser object has no attribute "pdfpath".\n' + \
               'The most likely problem is that you have not run latex.'
        assert os.path.exists(self.pdfpath), \
               'pres_rst_parser.pdfpath does not exist.\n' + \
               'The most likely problem is that you have not run latex.'

        ##         if not hasattr(self,'pdfpath'):
        ##             print('you must call pres_rst_parser.rst_team before sending team email')
        ##             return
        ##         if not os.path.exists(self.pdfpath):
        ##             print('pdf does not exist: '+self.pdfpath)
        ##             print('You need to run latex.')
        ##             return

        #emails = self.get_emails()
        emails = self.emails
        #print('emails=' + str(emails))
        #addresses = emails.replace(';',',')
        #addresses = ['*****@*****.**', '*****@*****.**']

        body = "The attached pdf contains your team grade and my feedback."

        gmail_smtp.sendMail(emails, subject, body, self.pdfpath)
    def compose_and_send_team_gmail(self, subject):#, ga):
        """ga is a gmail account instance from libgmail that has
        already been logged into."""
        assert hasattr(self, 'pdfpath'), \
               'pres_rst_parser object has no attribute "pdfpath".\n' + \
               'The most likely problem is that you have not run latex.'
        assert os.path.exists(self.pdfpath), \
               'pres_rst_parser.pdfpath does not exist.\n' + \
               'The most likely problem is that you have not run latex.'

##         if not hasattr(self,'pdfpath'):
##             print('you must call pres_rst_parser.rst_team before sending team email')
##             return
##         if not os.path.exists(self.pdfpath):
##             print('pdf does not exist: '+self.pdfpath)
##             print('You need to run latex.')
##             return

        #emails = self.get_emails()
        emails = self.emails
        #print('emails=' + str(emails))
        #addresses = emails.replace(';',',')
        #addresses = ['*****@*****.**', '*****@*****.**']

        body = "The attached pdf contains your team grade and my feedback."

        gmail_smtp.sendMail(emails, subject, body, self.pdfpath)
Beispiel #3
0
 def send_email(self, subject):
     email = self.email
     #addresses = ['*****@*****.**', '*****@*****.**', '*****@*****.**']
     body = "The attached pdf contains feedback on your individual speaking and delivery grade."
     assert hasattr(self, 'pdfpath'), \
            'speaker object has no attribute "pdfpath".\n' + \
            'The most likely problem is that you have not run latex.'
     assert os.path.exists(self.pdfpath), \
            'speaker.pdfpath does not exist.\n' + \
            'The most likely problem is that you have not run latex.'
     gmail_smtp.sendMail(email, subject, body, self.pdfpath)
 def send_email(self, subject):
     email = self.email
     #addresses = ['*****@*****.**', '*****@*****.**', '*****@*****.**']
     body = "The attached pdf contains feedback on your individual speaking and delivery grade."
     assert hasattr(self, 'pdfpath'), \
            'speaker object has no attribute "pdfpath".\n' + \
            'The most likely problem is that you have not run latex.'
     assert os.path.exists(self.pdfpath), \
            'speaker.pdfpath does not exist.\n' + \
            'The most likely problem is that you have not run latex.'
     gmail_smtp.sendMail(email, subject, body, self.pdfpath)