def __str__(self):
     disp = self.display_name
     if not parser.SPECIALS.isdisjoint(disp):
         disp = parser.quote_string(disp)
     if disp:
         addr_spec = '' if self.addr_spec=='<>' else self.addr_spec
         return "{} <{}>".format(disp, addr_spec)
     return self.addr_spec
 def __str__(self):
     if self.display_name is None and len(self.addresses)==1:
         return str(self.addresses[0])
     disp = self.display_name
     if disp is not None and not parser.SPECIALS.isdisjoint(disp):
         disp = parser.quote_string(disp)
     adrstr = ", ".join(str(x) for x in self.addresses)
     adrstr = ' ' + adrstr if adrstr else adrstr
     return "{}:{};".format(disp, adrstr)
Exemple #3
0
 def __str__(self):
     nameset = set(self.display_name)
     if len(nameset) > len(nameset - parser.SPECIALS):
         disp = parser.quote_string(self.display_name)
     else:
         disp = self.display_name
     if disp:
         addr_spec = '' if self.addr_spec == '<>' else self.addr_spec
         return "{} <{}>".format(disp, addr_spec)
     return self.addr_spec
Exemple #4
0
 def __str__(self):
     nameset = set(self.display_name)
     if len(nameset) > len(nameset - parser.SPECIALS):
         disp = parser.quote_string(self.display_name)
     else:
         disp = self.display_name
     if disp:
         addr_spec = "" if self.addr_spec == "<>" else self.addr_spec
         return "{} <{}>".format(disp, addr_spec)
     return self.addr_spec
Exemple #5
0
 def __str__(self):
     if self.display_name is None and len(self.addresses) == 1:
         return str(self.addresses[0])
     disp = self.display_name
     if disp is not None:
         nameset = set(disp)
         if len(nameset) > len(nameset - parser.SPECIALS):
             disp = parser.quote_string(disp)
     adrstr = ", ".join(str(x) for x in self.addresses)
     adrstr = " " + adrstr if adrstr else adrstr
     return "{}:{};".format(disp, adrstr)
Exemple #6
0
 def __str__(self):
     if self.display_name is None and len(self.addresses) == 1:
         return str(self.addresses[0])
     disp = self.display_name
     if disp is not None:
         nameset = set(disp)
         if len(nameset) > len(nameset - parser.SPECIALS):
             disp = parser.quote_string(disp)
     adrstr = ', '.join(str(x) for x in self.addresses)
     adrstr = ' ' + adrstr if adrstr else adrstr
     return '{}:{};'.format(disp, adrstr)
Exemple #7
0
 def addr_spec(self):
     nameset = set(self.username)
     if len(nameset) > len(nameset - parser.DOT_ATOM_ENDS):
         lp = parser.quote_string(self.username)
     else:
         lp = self.username
     if self.domain:
         return lp + '@' + self.domain
     if not lp:
         return '<>'
     return lp
 def addr_spec(self):
     nameset = set(self.username)
     if len(nameset) > len(nameset - parser.DOT_ATOM_ENDS):
         lp = parser.quote_string(self.username)
     else:
         lp = self.username
     if self.domain:
         return lp + '@' + self.domain
     if not lp:
         return '<>'
     return lp
 def addr_spec(self):
     """The addr_spec (username@domain) portion of the address, quoted
     according to RFC 5322 rules, but with no Content Transfer Encoding.
     """
     lp = self.username
     if not parser.DOT_ATOM_ENDS.isdisjoint(lp):
         lp = parser.quote_string(lp)
     if self.domain:
         return lp + '@' + self.domain
     if not lp:
         return '<>'
     return lp
Exemple #10
0
 def addr_spec(self):
     """The addr_spec (username@domain) portion of the address, quoted
     according to RFC 5322 rules, but with no Content Transfer Encoding.
     """
     nameset = set(self.username)
     if len(nameset) > len(nameset - parser.DOT_ATOM_ENDS):
         lp = parser.quote_string(self.username)
     else:
         lp = self.username
     if self.domain:
         return lp + '@' + self.domain
     if not lp:
         return '<>'
     return lp
Exemple #11
0
 def addr_spec(self):
     """The addr_spec (username@domain) portion of the address, quoted
     according to RFC 5322 rules, but with no Content Transfer Encoding.
     """
     nameset = set(self.username)
     if len(nameset) > len(nameset - parser.DOT_ATOM_ENDS):
         lp = parser.quote_string(self.username)
     else:
         lp = self.username
     if self.domain:
         return lp + "@" + self.domain
     if not lp:
         return "<>"
     return lp