| OLD | NEW |
| 1 from __future__ import print_function |
| 2 |
| 1 import logging | 3 import logging |
| 2 import urllib2 | 4 import urllib2 |
| 3 | 5 |
| 4 import kerberos as krb | 6 import kerberos as krb |
| 5 | 7 |
| 6 class GssapiAuthError(Exception): | 8 class GssapiAuthError(Exception): |
| 7 """raised on error during authentication process""" | 9 """raised on error during authentication process""" |
| 8 | 10 |
| 9 import re | 11 import re |
| 10 RGX = re.compile('(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I) | 12 RGX = re.compile('(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I) |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 # debug | 79 # debug |
| 78 import logging | 80 import logging |
| 79 logging.basicConfig(level=logging.DEBUG) | 81 logging.basicConfig(level=logging.DEBUG) |
| 80 # handle cookies | 82 # handle cookies |
| 81 import cookielib | 83 import cookielib |
| 82 cj = cookielib.CookieJar() | 84 cj = cookielib.CookieJar() |
| 83 ch = urllib2.HTTPCookieProcessor(cj) | 85 ch = urllib2.HTTPCookieProcessor(cj) |
| 84 # test with url sys.argv[1] | 86 # test with url sys.argv[1] |
| 85 h = HTTPGssapiAuthHandler() | 87 h = HTTPGssapiAuthHandler() |
| 86 response = urllib2.build_opener(h, ch).open(sys.argv[1]) | 88 response = urllib2.build_opener(h, ch).open(sys.argv[1]) |
| 87 print '\nresponse: %s\n--------------\n' % response.code, response.info() | 89 print('\nresponse: %s\n--------------\n' % response.code, response.info()) |
| OLD | NEW |