Changeset 43
- Timestamp:
- 11/27/07 09:20:45 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkipplib/trunk/pkipplib/pkipplib.py
r42 r43 591 591 else : 592 592 self.url = self.getDefaultURL() 593 self.username = username 594 self.password = password 593 594 # If no username or password, use the ones set by CUPS, if any 595 self.username = username or os.environ.get("AUTH_USERNAME") 596 self.password = password or os.environ.get("AUTH_PASSWORD") 597 595 598 self.charset = charset 596 599 self.language = language … … 603 606 """Builds a default URL.""" 604 607 # TODO : encryption methods. 605 server = os.environ.get("CUPS_SERVER" ) or "localhost"606 port = os.environ.get("IPP_PORT" ) or 631608 server = os.environ.get("CUPS_SERVER", "localhost") 609 port = os.environ.get("IPP_PORT", "631") 607 610 if server.startswith("/") : 608 611 # it seems it's a unix domain socket. 609 612 # we can't handle this right now, so we use the default instead. 610 #return "http://localhost:%s" % port611 return "socket:%s" % server613 return "http://localhost:%s" % port 614 #return "socket:%s" % server # TODO : make this work ! 612 615 else : 613 616 return "http://%s:%s" % (server, port)