Changeset 33ea505 for server/lib/gutenbach/server/requests.py
- Timestamp:
- Jan 11, 2012, 6:58:43 PM (12 years ago)
- Branches:
- no-cups
- Children:
- 09790fe
- Parents:
- 4126d3d
- git-author:
- Jessica B. Hamrick <jhamrick@…> (01/11/12 18:58:43)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (01/11/12 18:58:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/lib/gutenbach/server/requests.py
r34a4e5d r33ea505 258 258 259 259 # get the job attributes and add them to the response 260 job s = self.printer.get_jobs(260 job_attrs = self.printer.get_jobs( 261 261 which_jobs=which_jobs, 262 requesting_user_name=user )263 for job in jobs:264 attrs = job.get_job_attributes(requested_attributes=attributes)262 requesting_user_name=user, 263 requested_attributes=attributes) 264 for attrs in job_attrs: 265 265 response.attribute_groups.append(ipp.AttributeGroup( 266 266 ipp.AttributeTags.JOB, attrs)) … … 354 354 355 355 # get attributes from the printer and add to response 356 job = self.printer.create_job(356 job_id = self.printer.create_job( 357 357 requesting_user_name=requesting_user_name, 358 358 job_name=job_name, 359 359 job_k_octets=job_k_octets) 360 attrs = self.printer.get_job_attributes(job_id) 360 361 response.attribute_groups.append(ipp.AttributeGroup( 361 ipp.AttributeTags.JOB, job.get_job_attributes()))362 ipp.AttributeTags.JOB, attrs)) 362 363 363 364 @handler_for(ipp.OperationCodes.PAUSE_PRINTER) … … 536 537 537 538 if 'requesting-user-name' in operation: 538 user_name = verify_attribute(539 requesting_user_name = verify_attribute( 539 540 operation['requesting-user-name'], ipp.RequestingUserName)[0] 540 541 541 542 try: 542 job = self.printer.get_job(job_id) 543 job.cancel() 543 self.printer.cancel_job(job_id, requesting_user_name=requesting_user_name) 544 544 except InvalidJobException: 545 545 raise ipp.errors.ClientErrorNotFound("bad job: %d" % job_id) … … 681 681 682 682 try: 683 job = self.printer.get_job(job_id)684 job.send_document(683 self.printer.send_document( 684 job_id, 685 685 request.data, 686 requesting_user_name=user_name,687 686 document_name=document_name, 688 compression=compression,689 687 document_format=document_format, 690 688 document_natural_language=document_natural_language, 689 requesting_user_name=user_name, 690 compression=compression, 691 691 last_document=last_document) 692 attrs = job.get_job_attributes()692 attrs = self.printer.get_job_attributes(job_id) 693 693 except InvalidJobException: 694 694 raise ipp.errors.ClientErrorNotFound("bad job: %d" % job_id) … … 796 796 # get the job attributes and add them to the response 797 797 try: 798 job = self.printer.get_job(job_id) 799 attrs = job.get_job_attributes(requested_attributes=requested_attributes) 798 attrs = self.printer.get_job_attributes( 799 job_id, 800 requested_attributes=requested_attributes) 800 801 except InvalidJobException: 801 802 raise ipp.errors.ClientErrorNotFound("bad job: %d" % job_id)
Note: See TracChangeset
for help on using the changeset viewer.