[tor-commits] [bridgedb/develop] Update bridgedb.parse.addr.extractEmailAddress docstring.

isis at torproject.org isis at torproject.org
Wed Apr 23 05:23:12 UTC 2014


commit 17cbc0a0eb10e84401d72ddcae8bb871c16a7c13
Author: Isis Lovecruft <isis at torproject.org>
Date:   Tue Apr 22 23:16:11 2014 +0000

    Update bridgedb.parse.addr.extractEmailAddress docstring.
---
 lib/bridgedb/parse/addr.py |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/bridgedb/parse/addr.py b/lib/bridgedb/parse/addr.py
index 26632ac..a354387 100644
--- a/lib/bridgedb/parse/addr.py
+++ b/lib/bridgedb/parse/addr.py
@@ -242,15 +242,15 @@ def canonicalizeEmailDomain(domain, domainmap):
     return permitted
 
 def extractEmailAddress(emailaddr):
-    """Given an email address, obtained, for example, via a ``From:`` or
+    """Given an email address, obtained for example, via a ``From:`` or
     ``Sender:`` email header, try to extract and parse (according to
-    :rfc:2822) the username and domain portions. Returns ``(username,
-    domain)`` on success; raises BadEmail on failure.
+    :rfc:`2822`) the local and domain portions.
 
     We only allow the following form::
-        ADDRSPEC := LOCAL_PART "@" DOMAIN
+
         LOCAL_PART := DOTATOM
         DOMAIN := DOTATOM
+        ADDRSPEC := LOCAL_PART "@" DOMAIN
 
     In particular, we are disallowing: obs-local-part, obs-domain, comment,
     and obs-FWS. Other forms exist, but none of the incoming services we
@@ -258,10 +258,9 @@ def extractEmailAddress(emailaddr):
 
     :param emailaddr: An email address to validate.
     :raises BadEmail: if the **emailaddr** couldn't be validated or parsed.
-    :rtype: tuple
     :returns: A tuple of the validated email address, containing the mail
-        username and the domain::
-            (LOCALPART, DOMAIN)
+        local part and the domain::
+            (LOCAL_PART, DOMAIN)
     """
     orig = emailaddr
 





More information about the tor-commits mailing list