~ar-python-hackers/authentication-results-python/0.2

« back to all changes in this revision

Viewing changes to authres_parse.py

  • Committer: julian at mehnle
  • Date: 2011-08-09 15:09:39 UTC
  • Revision ID: julian@mehnle.net-20110809150939-bwllv7wla030xskc
Stringify version number in order to allow number-type versions to be passed.  Minor clean-up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# See the License for the specific language governing permissions and
16
16
# limitations under the License.
17
17
 
18
 
"""
19
 
    Module for parsing "Authentication-Results" headers as defined in RFC 5451.
20
 
"""
 
18
'Module for parsing "Authentication-Results" headers as defined in RFC 5451.'
21
19
 
22
20
MODULE = 'authres_parse'
23
21
 
159
157
    def __init__(self, authserv_id = None, version = None, results = []):
160
158
        """
161
159
        Examples:
 
160
 
162
161
        >>> str(AuthenticationResultsHeader('test.example.org'))
163
162
        'Authentication-Results: test.example.org; none'
164
163
 
166
165
        'Authentication-Results: test.example.org 1; none'
167
166
        """
168
167
        self.authserv_id = authserv_id and authserv_id.lower()
169
 
        self.version     = version     and version.lower()
 
168
        self.version     = version     and str(version).lower()
170
169
        self.results     = results
171
170
 
172
171
    def __str__(self):