Changeset 97f20dd for server/lib/gutenbach/server/job.py
- Timestamp:
- Jan 22, 2012, 1:05:21 AM (12 years ago)
- Branches:
- no-cups
- Children:
- 2834b9a
- Parents:
- b3a56af
- git-author:
- Jessica B. Hamrick <jhamrick@…> (01/22/12 01:05:21)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (01/22/12 01:05:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/lib/gutenbach/server/job.py
r0494098 r97f20dd 168 168 self.player is not None and \ 169 169 not self.player.is_playing and \ 170 not self._why_done == "cancel led" and \170 not self._why_done == "canceled" and \ 171 171 not self._why_done == "aborted" 172 172 … … 202 202 self.player is not None and \ 203 203 self.player.is_done) or \ 204 (self._why_done == "cancel led" or \204 (self._why_done == "canceled" or \ 205 205 self._why_done == "aborted") 206 206 … … 214 214 215 215 @property 216 def is_cancel led(self):217 """Whether the job was cancel led.218 219 """ 220 221 return self.is_done and self._why_done == "cancel led"216 def is_canceled(self): 217 """Whether the job was canceled. 218 219 """ 220 221 return self.is_done and self._why_done == "canceled" 222 222 223 223 @property … … 235 235 236 236 HELD ---> PENDING ---> PROCESSING <--> STOPPED (aka paused) 237 ^ |---> CANCEL LED237 ^ |---> CANCELED 238 238 | |---> ABORTED 239 239 | |---> COMPLETE ---| … … 247 247 state = States.PROCESSING 248 248 elif self.is_playing and self.is_paused: 249 state = States. STOPPED249 state = States.PROCESSING_STOPPED 250 250 elif self.is_completed: 251 state = States.COMPLETE 252 elif self.is_cancel led:253 state = States.CANCEL LED251 state = States.COMPLETED 252 elif self.is_canceled: 253 state = States.CANCELED 254 254 elif self.is_aborted: 255 255 state = States.ABORTED 256 256 else: 257 state = States. HELD257 state = States.PENDING_HELD 258 258 return state 259 259 … … 293 293 """ 294 294 295 if not self.is_valid or self.state != States. HELD:295 if not self.is_valid or self.state != States.PENDING_HELD: 296 296 raise errors.InvalidJobStateException(self.state) 297 297 self.verify_document(document) … … 357 357 """Blocking cancel. The job must not have been previously 358 358 aborted or completed (though this method will succeed if it 359 was previously cancel led). This should be used to stop the359 was previously canceled). This should be used to stop the 360 360 job following an external request. 361 361 … … 371 371 self.player.mplayer_stop() 372 372 373 elif self.is_done and not self._why_done == "cancel led":374 raise errors.InvalidJobStateException(self.state) 375 376 logger.info("cancel led job %s" % str(self))377 self._why_done = "cancel led"373 elif self.is_done and not self._why_done == "canceled": 374 raise errors.InvalidJobStateException(self.state) 375 376 logger.info("canceled job %s" % str(self)) 377 self._why_done = "canceled" 378 378 379 379 def abort(self): 380 380 """Blocking abort. The job must not have been previously 381 cancel led or completed (though this method will succeed if it381 canceled or completed (though this method will succeed if it 382 382 was previously aborted). This should be used to stop the job 383 383 following internal errors.
Note: See TracChangeset
for help on using the changeset viewer.