Changeset 3468
- Timestamp:
- 12/12/08 00:31:04 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkipplib/trunk/pkipplib/pkipplib.py
r3437 r3468 650 650 data=req.dump()) 651 651 connection.add_header("Content-Type", "application/ipp") 652 proxyhandler = urllib2.ProxyHandler({}) 652 653 if self.username : 653 654 pwmanager = urllib2.HTTPPasswordMgrWithDefaultRealm() … … 658 659 self.password or "") 659 660 authhandler = urllib2.HTTPBasicAuthHandler(pwmanager) 660 opener = urllib2.build_opener(authhandler) 661 urllib2.install_opener(opener) 661 opener = urllib2.build_opener(proxyhandler, authhandler) 662 662 else : # TODO : also do this in the 'if' part 663 if url.startswith("socket:") : 663 if not url.startswith("socket:") : 664 opener = urllib2.build_opener(proxyhandler) 665 else : 664 666 class SocketHandler(urllib2.HTTPHandler) : 665 667 """A class to handle IPP connections over an Unix domain socket.""" … … 676 678 return s.makefile(mode="r+b") 677 679 678 opener = urllib2.build_opener( SocketHandler())679 urllib2.install_opener(opener) 680 sys.stderr.write("Opener installed\n")680 opener = urllib2.build_opener(proxyhandler, SocketHandler()) 681 682 urllib2.install_opener(opener) 681 683 self.lastError = None 682 684 self.lastErrorMessage = None