コード例 #1
0
    def handleEmailNotifications(self, lastDate):
        """Places new Gmail notifications in the Notifier's queue."""
        emails = Gmail.fetchUnreadEmails(self.profile, since=lastDate)
        if emails:
            lastDate = Gmail.getMostRecentDate(emails)

        def styleEmail(e):
            return "New email from %s." % Gmail.getSender(e)

        for e in emails:
            self.q.put(styleEmail(e))

        return lastDate
コード例 #2
0
    def handleEmailNotifications(self, lastDate):
        """Places new Gmail notifications in the Notifier's queue."""
        emails = Gmail.fetchUnreadEmails(self.profile, since=lastDate)
        if emails:
            lastDate = Gmail.getMostRecentDate(emails)

        def styleEmail(e):
            return "New email from %s." % Gmail.getSender(e)

        for e in emails:
            self.q.put(styleEmail(e))

        return lastDate
コード例 #3
0
ファイル: notifier.py プロジェクト: drkmsmithjr/erica
    def handleEmailNotifications(self, lastDate):
        """Places new Gmail notifications in the Notifier's queue.
	We place a limit of 50 unread emails at a time """

        emails = Gmail.fetchUnreadEmails(self.profile, since=lastDate)
        #	print(emails)
        print("inside the email notification routine")
        if emails:
            lastDate = Gmail.getMostRecentDate(emails)

        def styleEmail(e):
            return "New email from %s." % Gmail.getSender(e)

        for e in emails:
            self.q.put(styleEmail(e))
        return lastDate
コード例 #4
0
ファイル: notifier.py プロジェクト: AmI-2014/SmartUp
    def handleEmailNotifications(self, lastDate):
        
        emails = Gmail.fetchUnreadEmails(self.profile, since=lastDate, markRead=True)
        if emails:
            lastDate = Gmail.getMostRecentDate(emails)

        def styleEmail(e):
            nome = Gmail.getSender(e)
            if string.find(nome,"Google Calendar") != -1:
                return e.get('Subject',' ')
            else:
                return "New email from %s." % Gmail.getSender(e)

        for e in emails:
            self.q.put(styleEmail(e))

        return lastDate
コード例 #5
0
    def handleEmailNotifications(self, lastDate):

        emails = Gmail.fetchUnreadEmails(self.profile,
                                         since=lastDate,
                                         markRead=True)
        if emails:
            lastDate = Gmail.getMostRecentDate(emails)

        def styleEmail(e):
            nome = Gmail.getSender(e)
            if string.find(nome, "Google Calendar") != -1:
                return e.get('Subject', ' ')
            else:
                return "New email from %s." % Gmail.getSender(e)

        for e in emails:
            self.q.put(styleEmail(e))

        return lastDate