Changes in / [8de3c81:7c8a2f8]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/lib/gutenbach/server/requests.py
r8de3c81 r7c8a2f8 268 268 @handler_for(ipp.OperationCodes.PRINT_URI) 269 269 def print_uri(self, request, response): 270 """3.2.2 Print-URI Operation271 272 This OPTIONAL operation is identical to the Print-Job operation273 (section 3.2.1) except that a client supplies a URI reference to the274 document data using the 'document-uri' (uri) operation attribute (in275 Group 1) rather than including the document data itself. Before276 returning the response, the Printer MUST validate that the Printer277 supports the retrieval method (e.g., http, ftp, etc.) implied by the278 URI, and MUST check for valid URI syntax. If the client-supplied URI279 scheme is not supported, i.e. the value is not in the Printer280 object's 'referenced-uri-scheme-supported' attribute, the Printer281 object MUST reject the request and return the 'client-error-uri-282 scheme-not-supported' status code.283 284 The IPP Printer MAY validate the accessibility of the document as285 part of the operation or subsequently. If the Printer determines an286 accessibility problem before returning an operation response, it287 rejects the request and returns the 'client-error-document-access-288 error' status code. The Printer MAY also return a specific document289 access error code using the 'document-access-error' operation290 attribute (see section 3.1.6.4).291 292 If the Printer determines this document accessibility problem after293 accepting the request and returning an operation response with one of294 the successful status codes, the Printer adds the 'document-access-295 error' value to the job's 'job-state-reasons' attribute and MAY populate the job's 'job-document-access-errors' Job Description296 attribute (see section 4.3.11). See The Implementer's Guide [IPP-297 IIG] for suggested additional checks.298 299 If the Printer object supports this operation, it MUST support the300 'reference-uri-schemes-supported' Printer attribute (see section 4.4.27).301 302 It is up to the IPP object to interpret the URI and subsequently303 'pull' the document from the source referenced by the URI string."""304 270 raise ipp.errors.ServerErrorOperationNotSupported 305 271 … … 398 364 @handler_for(ipp.OperationCodes.PAUSE_PRINTER) 399 365 def pause_printer(self, request, response): 400 """401 3.2.7 Pause-Printer Operation402 403 This OPTIONAL operation allows a client to stop the Printer object404 from scheduling jobs on all its devices. Depending on405 implementation, the Pause-Printer operation MAY also stop the Printer406 from processing the current job or jobs. Any job that is currently407 being printed is either stopped as soon as the implementation permits408 or is completed, depending on implementation. The Printer object409 MUST still accept create operations to create new jobs, but MUST410 prevent any jobs from entering the 'processing' state.411 412 If the Pause-Printer operation is supported, then the Resume-Printer413 operation MUST be supported, and vice-versa.414 415 The IPP Printer stops the current job(s) on its device(s) that were416 in the 'processing' or 'processing-stopped' states as soon as the417 implementation permits. If the implementation will take appreciable418 time to stop, the IPP Printer adds the 'moving-to-paused' value to419 the Printer object's 'printer-state-reasons' attribute (see section420 4.4.12). When the device(s) have all stopped, the IPP Printer421 transitions the Printer object to the 'stopped' state, removes the422 'moving-to-paused' value, if present, and adds the 'paused' value to423 the Printer object's 'printer-state-reasons' attribute.424 425 When the current job(s) complete that were in the 'processing' state,426 the IPP Printer transitions them to the 'completed' state. When the427 current job(s) stop in mid processing that were in the 'processing'428 state, the IPP Printer transitions them to the 'processing-stopped'429 state and adds the 'printer-stopped' value to the job's 'job-state-430 reasons' attribute.431 432 For any jobs that are 'pending' or 'pending-held', the 'printer-433 stopped' value of the jobs' 'job-state-reasons' attribute also434 applies. However, the IPP Printer NEED NOT update those jobs' 'job-435 state-reasons' attributes and only need return the 'printer-stopped'436 value when those jobs are queried (so-called 'lazy evaluation').437 438 Whether the Pause-Printer operation affects jobs that were submitted439 to the device from other sources than the IPP Printer object in the440 same way that the Pause-Printer operation affects jobs that were441 submitted to the IPP Printer object using IPP, depends on442 implementation, i.e., on whether the IPP protocol is being used as a443 universal management protocol or just to manage IPP jobs,444 respectively.445 446 The IPP Printer MUST accept the request in any state and transition447 the Printer to the indicated new 'printer-state' before returning as448 follows:449 450 Current New 'printer IPP Printer's response status451 'printer- 'printer- -state- code and action:452 state' state' reasons'453 454 'idle' 'stopped' 'paused' 'successful-ok'455 'processing' 'processing' 'moving- OPTION 1: 'successful-ok';456 to- Later, when all output has457 paused' stopped, the 'printer-state'458 becomes 'stopped', and the459 'paused' value replaces the460 'moving-to-paused' value in the461 'printer-state-reasons'462 attribute463 'processing' 'stopped' 'paused' OPTION 2: 'successful-ok';464 all device output stopped465 immediately466 'stopped' 'stopped' 'paused' 'successful-ok'467 468 Access Rights: The authenticated user (see section 8.3) performing469 this operation must be an operator or administrator of the Printer470 object (see Sections 1 and 8.5). Otherwise, the IPP Printer MUST471 reject the operation and return: 'client-error-forbidden', 'client-472 error-not-authenticated', or 'client-error-not-authorized' as473 appropriate.474 475 3.2.7.1 Pause-Printer Request476 477 The following groups of attributes are part of the Pause-Printer478 Request:479 480 Group 1: Operation Attributes481 482 Natural Language and Character Set:483 The 'attributes-charset' and 'attributes-natural-language'484 attributes as described in section 3.1.4.1.485 486 Target:487 The 'printer-uri' (uri) operation attribute which is the target488 for this operation as described in section 3.1.5.489 490 Requesting User Name:491 The 'requesting-user-name' (name(MAX)) attribute SHOULD be492 supplied by the client as described in section 8.3.493 494 3.2.7.2 Pause-Printer Response495 496 The following groups of attributes are part of the Pause-Printer497 Response:498 499 Group 1: Operation Attributes500 501 Status Message:502 In addition to the REQUIRED status code returned in every503 response, the response OPTIONALLY includes a 'status-message'504 (text(255)) and/or a 'detailed-status-message' (text(MAX))505 operation attribute as described in sections 13 and 3.1.6.506 507 Natural Language and Character Set:508 The 'attributes-charset' and 'attributes-natural-language'509 attributes as described in section 3.1.4.2.510 511 Group 2: Unsupported Attributes512 513 See section 3.1.7 for details on returning Unsupported Attributes.514 515 516 """517 366 raise ipp.errors.ServerErrorOperationNotSupported 518 367 519 368 @handler_for(ipp.OperationCodes.RESUME_PRINTER) 520 369 def resume_printer(self, request, response): 521 """522 3.2.8 Resume-Printer Operation523 524 This operation allows a client to resume the Printer object525 scheduling jobs on all its devices. The Printer object MUST remove526 the 'paused' and 'moving-to-paused' values from the Printer object's527 'printer-state-reasons' attribute, if present. If there are no other528 reasons to keep a device paused (such as media-jam), the IPP Printer529 is free to transition itself to the 'processing' or 'idle' states,530 depending on whether there are jobs to be processed or not,531 respectively, and the device(s) resume processing jobs.532 533 If the Pause-Printer operation is supported, then the Resume-Printer534 operation MUST be supported, and vice-versa.535 536 The IPP Printer removes the 'printer-stopped' value from any job's537 'job-state-reasons' attributes contained in that Printer.538 539 The IPP Printer MUST accept the request in any state, transition the540 Printer object to the indicated new state as follows:541 542 543 Current New 'printer- IPP Printer's response status code and544 'printer- state' action:545 state'546 547 'idle' 'idle' 'successful-ok'548 'processing' 'processing' 'successful-ok'549 550 'stopped' 'processing' 'successful-ok';551 when there are jobs to be processed552 'stopped' 'idle' 'successful-ok';553 when there are no jobs to be processed.554 555 Access Rights: The authenticated user (see section 8.3) performing556 this operation must be an operator or administrator of the Printer557 object (see Sections 1 and 8.5). Otherwise, the IPP Printer MUST558 reject the operation and return: 'client-error-forbidden', 'client-559 error-not-authenticated', or 'client-error-not-authorized' as560 appropriate.561 562 The Resume-Printer Request and Resume-Printer Response have the same563 attribute groups and attributes as the Pause-Printer operation (see564 sections 3.2.7.1 and 3.2.7.2).565 """566 370 raise ipp.errors.ServerErrorOperationNotSupported 567 371 … … 638 442 @handler_for(ipp.OperationCodes.SET_PRINTER_ATTRIBUTES) 639 443 def set_printer_attributes(self, request, response): 640 641 444 raise ipp.errors.ServerErrorOperationNotSupported 642 445 … … 896 699 @handler_for(ipp.OperationCodes.SEND_URI) 897 700 def send_uri(self, request, response): 898 <<<<<<< HEAD899 raise ipp.errors.ServerErrorOperationNotSupported900 =======901 701 """3.2.2 Send URI 902 702 … … 1028 828 response.attribute_groups.append(ipp.AttributeGroup( 1029 829 ipp.AttributeTags.JOB, attrs)) 1030 >>>>>>> 7c8a2f82df069878680146d8ac18339ec96bd4871031 830 1032 831 @handler_for(ipp.OperationCodes.GET_JOB_ATTRIBUTES) … … 1136 935 @handler_for(ipp.OperationCodes.SET_JOB_ATTRIBUTES) 1137 936 def set_job_attributes(self, request, response): 1138 1139 937 raise ipp.errors.ServerErrorOperationNotSupported 1140 938
Note: See TracChangeset
for help on using the changeset viewer.