Merged the last two commits from branch clean-optionparser into one c…
…ommit on branch mergeable-optionparser
Implemented phw's feedback
Additionally removed fallback solution for unittests in request.py on line 80
Since it was not a elegant solution anyway and was only there for testing
If get_payload returns a string instead of a list, it will mean that the parsing
failed due to an invalid email format and raises an exception
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
@@ -55,6 +55,10 @@ class TooSoonEmail(addr.BadEmail):
"""Raised when we got a request from this address too recently."""
classEmailPayloadNotParseable(Exception):
"""Raised when get_payload() returns a string instead of a list."""
classEmailRequestedHelp(Exception):
"""Raised when a client has emailed requesting help."""
@@ -63,6 +67,14 @@ class EmailRequestedKey(Exception):
"""Raised when an incoming email requested a copy of our GnuPG keys."""
classEmailNoTransportSpecified(Exception):
"""Raised when an incoming email requested a transport without specifying the protocol."""
classEmailNoCountryCode(Exception):
"""Raised when an incoming email requested unblocked bridges but did not specify a country code"""
classEmailDistributor(Distributor):
"""Object that hands out bridges based on the email address of an incoming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
@@ -50,6 +50,7 @@
from __future__ importunicode_literals
importemail.message
fromemailimportpolicy
importlogging
importio
importsocket
@@ -252,7 +253,7 @@ def getIncomingMessage(self):
:returns: A ``Message`` comprised of all lines received thus far.