Changeset 9
- Timestamp:
- 05/19/06 16:37:38 (19 years ago)
- Location:
- pkipplib/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pkipplib/trunk/ipplib/ipplib.py
r8 r9 591 591 self.language = language 592 592 593 def identifierToURI(self, service, ident) : 594 """Transforms an identifier into a particular URI depending on requested service.""" 595 return "%s/%s/%s" % (self.url.replace("http://", "ipp://"), 596 service, 597 ident) 598 593 599 def newRequest(self, operationid=None) : 594 600 """Generates a new empty request.""" … … 609 615 """Retrieves a print job's attributes.""" 610 616 req = self.newRequest(IPP_GET_JOB_ATTRIBUTES) 611 req.operation["job-uri"] = ("uri", "%s/jobs/%s" % (self.url.replace("http://", "ipp://"), jobid))617 req.operation["job-uri"] = ("uri", self.identifierToURI("jobs", jobid)) 612 618 return req.doRequest() 619 620 def getPPD(self, queuename) : 621 """Retrieves the PPD for a particular queuename.""" 622 req = self.newRequest(IPP_GET_PRINTER_ATTRIBUTES) 623 req.operation["printer-uri"] = ("uri", self.identifierToURI("printers", queuename)) 624 for attrib in ("printer-uri-supported", "printer-type", "member-uris") : 625 req.operation["requested-attributes"] = ("nameWithoutLanguage", attrib) 626 return req.doRequest() # TODO : get the PPD from the actual print server 613 627 614 628 -
pkipplib/trunk/tests/test.py
r5 r9 27 27 28 28 cups = ipplib.CUPS() 29 answer = cups.getJobAttributes(566) 29 answer = cups.getPPD("HL6050DN") 30 #answer = cups.getJobAttributes(566) 30 31 print answer 31 32 #print answer.operation["attributes-charset"]