コード例 #1
0
ファイル: contact_bb.py プロジェクト: Sts0mrg0/ASynK
    def _snarf_emails_from_parse_res (self, pr):
        ems = pr['emails']

        if ems:
            str_re = self.get_store().get_str_re()
            ems = re.findall(str_re, ems)
            ems = [chompq(x) for x in ems]

            domains = self.get_email_domains()

            for em in ems:
                if em == 'nil':
                    continue

                home, work, other = classify_email_addr(em, domains)

                if home:
                    self.add_email_home(em)
                elif work:
                    self.add_email_work(em)
                elif other:
                    self.add_email_other(em)
                else:
                    self.add_email_work(em)

                if not self.get_email_prim():
                    self.set_email_prim(em)
コード例 #2
0
ファイル: contact_bb.py プロジェクト: yiufung/ASynK
    def _snarf_emails_from_parse_res(self, pr):
        ems = pr['emails']

        if ems:
            str_re = self.get_store().get_str_re()
            ems = re.findall(str_re, ems)
            ems = [chompq(x) for x in ems]

            domains = self.get_email_domains()

            for em in ems:
                if em == 'nil':
                    continue

                home, work, other = classify_email_addr(em, domains)

                if home:
                    self.add_email_home(em)
                elif work:
                    self.add_email_work(em)
                elif other:
                    self.add_email_other(em)
                else:
                    self.add_email_work(em)

                if not self.get_email_prim():
                    self.set_email_prim(em)
コード例 #3
0
ファイル: contact_ex.py プロジェクト: Sts0mrg0/ASynK
    def _snarf_emails_from_ews_con (self, ews_con):
        """Classify each email address in ews_con as home/work/other and store
        them away. Classification is done based on the domain of the address
        as set in the config file."""

        domains = self.get_email_domains()

        for email in ews_con.emails.entries:
            addr = email.value
            home, work, other = utils.classify_email_addr(addr, domains)

            if home:
                self.add_email_home(addr)
            elif work:
                self.add_email_work(addr)
            elif other:
                self.add_email_other(addr)
            else:
                self.add_email_work(addr)
コード例 #4
0
    def _snarf_emails_from_ews_con(self, ews_con):
        """Classify each email address in ews_con as home/work/other and store
        them away. Classification is done based on the domain of the address
        as set in the config file."""

        domains = self.get_email_domains()

        for email in ews_con.emails.entries:
            addr = email.value
            home, work, other = utils.classify_email_addr(addr, domains)

            if home:
                self.add_email_home(addr)
            elif work:
                self.add_email_work(addr)
            elif other:
                self.add_email_other(addr)
            else:
                self.add_email_work(addr)
コード例 #5
0
    def _snarf_email(self, olpd, tag, domains):
        """Fetch the email address using the specified tag, classify the
        addres into home, work or other, and file them into the appropriate
        property field.

        tag is the property tag that is to be used to look up an email
        address from the properties array. domains is the email_domains
        dictionary from the app state config file that is used to """

        addr = self._get_olprop(olpd, tag)
        if not addr:
            return

        home, work, other = utils.classify_email_addr(addr, domains)

        if home:
            self.add_email_home(addr)
        elif work:
            self.add_email_work(addr)
        elif other:
            self.add_email_other(addr)
        else:
            self.add_email_work(addr)
コード例 #6
0
ファイル: contact_ol.py プロジェクト: Ekaptenn/ASynK
    def _snarf_email (self, olpd, tag, domains):
        """Fetch the email address using the specified tag, classify the
        addres into home, work or other, and file them into the appropriate
        property field.

        tag is the property tag that is to be used to look up an email
        address from the properties array. domains is the email_domains
        dictionary from the app state config file that is used to """

        addr = self._get_olprop(olpd, tag)
        if not addr:
            return

        home, work, other = utils.classify_email_addr(addr, domains)

        if home:
            self.add_email_home(addr)
        elif work:
            self.add_email_work(addr)
        elif other:
            self.add_email_other(addr)
        else:
            self.add_email_work(addr)