Changeset 2834b9a
- Timestamp:
- Jan 22, 2012, 1:12:53 AM (12 years ago)
- Branches:
- no-cups
- Children:
- 410ad69
- Parents:
- 97f20dd
- git-author:
- Jessica B. Hamrick <jhamrick@…> (01/22/12 01:12:53)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (01/22/12 01:12:53)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/lib/gutenbach/server/job.py
r97f20dd r2834b9a 231 231 @property 232 232 def state(self): 233 """State status codes (these are equivalent to the IPP 234 job-state status codes). State transitions are as follows: 235 236 HELD ---> PENDING ---> PROCESSING <--> STOPPED (aka paused) 237 ^ |---> CANCELED 238 | |---> ABORTED 239 | |---> COMPLETE ---| 240 |--------------------------------| 241 242 """ 233 """RFC 2911: 4.3.7 job-state (type1 enum) 234 235 'pending': The job is a candidate to start processing, but is 236 not yet processing. 237 238 'pending-held': The job is not a candidate for processing for 239 any number of reasons but will return to the 'pending' 240 state as soon as the reasons are no longer present. The 241 job's 'job-state-reason' attribute MUST indicate why the 242 job is no longer a candidate for processing. 243 244 'processing': One or more of: 245 246 1. the job is using, or is attempting to use, one or more 247 purely software processes that are analyzing, creating, 248 or interpreting a PDL, etc., 249 2. the job is using, or is attempting to use, one or more 250 hardware devices that are interpreting a PDL, making 251 marks on a medium, and/or performing finishing, such as 252 stapling, etc., 253 3. the Printer object has made the job ready for printing, 254 but the output device is not yet printing it, either 255 because the job hasn't reached the output device or 256 because the job is queued in the output device or some 257 other spooler, awaiting the output device to print it. 258 259 When the job is in the 'processing' state, the entire job 260 state includes the detailed status represented in the 261 Printer object's 'printer-state', 'printer-state- 262 reasons', and 'printer-state-message' attributes. 263 264 Implementations MAY, though they NEED NOT, include 265 additional values in the job's 'job-state-reasons' 266 attribute to indicate the progress of the job, such as 267 adding the 'job-printing' value to indicate when the 268 output device is actually making marks on paper and/or the 269 'processing-to-stop-point' value to indicate that the IPP 270 object is in the process of canceling or aborting the 271 job. Most implementations won't bother with this nuance. 272 273 'processing-stopped': The job has stopped while processing for 274 any number of reasons and will return to the 'processing' 275 state as soon as the reasons are no longer present. 276 277 The job's 'job-state-reason' attribute MAY indicate why 278 the job has stopped processing. For example, if the output 279 device is stopped, the 'printer-stopped' value MAY be 280 included in the job's 'job-state-reasons' attribute. 281 282 Note: When an output device is stopped, the device usually 283 indicates its condition in human readable form locally at 284 the device. A client can obtain more complete device 285 status remotely by querying the Printer object's 286 'printer-state', 'printer-state-reasons' and 'printer- 287 state-message' attributes. 288 289 'canceled': The job has been canceled by a Cancel-Job 290 operation and the Printer object has completed canceling 291 the job and all job status attributes have reached their 292 final values for the job. While the Printer object is 293 canceling the job, the job remains in its current state, 294 but the job's 'job-state-reasons' attribute SHOULD contain 295 the 'processing-to-stop-point' value and one of the 296 'canceled-by-user', 'canceled-by-operator', or 297 'canceled-at-device' value. When the job moves to the 298 'canceled' state, the 'processing-to-stop-point' value, if 299 present, MUST be removed, but the 'canceled-by-xxx', if 300 present, MUST remain. 301 302 'aborted': The job has been aborted by the system, usually 303 while the job was in the 'processing' or 'processing- 304 stopped' state and the Printer has completed aborting the 305 job and all job status attributes have reached their final 306 values for the job. While the Printer object is aborting 307 the job, the job remains in its current state, but the 308 job's 'job-state-reasons' attribute SHOULD contain the 309 'processing-to-stop-point' and 'aborted-by- system' 310 values. When the job moves to the 'aborted' state, the 311 'processing-to-stop-point' value, if present, MUST be 312 removed, but the 'aborted-by-system' value, if present, 313 MUST remain. 314 315 'completed': The job has completed successfully or with 316 warnings or errors after processing and all of the job 317 media sheets have been successfully stacked in the 318 appropriate output bin(s) and all job status attributes 319 have reached their final values for the job. The job's 320 'job-state-reasons' attribute SHOULD contain one of: 321 'completed-successfully', 'completed-with-warnings', or 322 'completed-with-errors' values. 323 324 The final value for this attribute MUST be one of: 325 'completed', 'canceled', or 'aborted' before the Printer 326 removes the job altogether. The length of time that jobs 327 remain in the 'canceled', 'aborted', and 'completed' states 328 depends on implementation. See section 4.3.7.2. 329 330 The following figure shows the normal job state transitions. 331 332 +----> canceled 333 / 334 +----> pending --------> processing ---------+------> completed 335 | ^ ^ \ 336 --->+ | | +----> aborted 337 | v v / 338 +----> pending-held processing-stopped ---+ 339 340 Normally a job progresses from left to right. Other state 341 transitions are unlikely, but are not forbidden. Not shown are 342 the transitions to the 'canceled' state from the 'pending', 343 'pending- held', and 'processing-stopped' states. 344 345 Jobs reach one of the three terminal states: 'completed', 346 'canceled', or 'aborted', after the jobs have completed all 347 activity, including stacking output media, after the jobs have 348 completed all activity, and all job status attributes have 349 reached their final values for the job. 350 351 """ 352 353 # XXX verify that these transitions are correct! 243 354 244 355 if self.is_ready:
Note: See TracChangeset
for help on using the changeset viewer.