Ignore:
Timestamp:
Jan 22, 2012, 1:05:21 AM (12 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
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)
Message:

Add documentation for printer and job attributes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach/server/job.py

    r0494098 r97f20dd  
    168168               self.player is not None and \
    169169               not self.player.is_playing and \
    170                not self._why_done == "cancelled" and \
     170               not self._why_done == "canceled" and \
    171171               not self._why_done == "aborted"
    172172
     
    202202                self.player is not None and \
    203203                self.player.is_done) or \
    204                 (self._why_done == "cancelled" or \
     204                (self._why_done == "canceled" or \
    205205                 self._why_done == "aborted")
    206206
     
    214214
    215215    @property
    216     def is_cancelled(self):
    217         """Whether the job was cancelled.
    218 
    219         """
    220 
    221         return self.is_done and self._why_done == "cancelled"
     216    def is_canceled(self):
     217        """Whether the job was canceled.
     218
     219        """
     220
     221        return self.is_done and self._why_done == "canceled"
    222222
    223223    @property
     
    235235       
    236236            HELD ---> PENDING ---> PROCESSING <--> STOPPED (aka paused)
    237                          ^              |---> CANCELLED
     237                         ^              |---> CANCELED
    238238                         |              |---> ABORTED
    239239                         |              |---> COMPLETE ---|
     
    247247            state = States.PROCESSING
    248248        elif self.is_playing and self.is_paused:
    249             state = States.STOPPED
     249            state = States.PROCESSING_STOPPED
    250250        elif self.is_completed:
    251             state = States.COMPLETE
    252         elif self.is_cancelled:
    253             state = States.CANCELLED
     251            state = States.COMPLETED
     252        elif self.is_canceled:
     253            state = States.CANCELED
    254254        elif self.is_aborted:
    255255            state = States.ABORTED
    256256        else:
    257             state = States.HELD
     257            state = States.PENDING_HELD
    258258        return state
    259259
     
    293293        """
    294294
    295         if not self.is_valid or self.state != States.HELD:
     295        if not self.is_valid or self.state != States.PENDING_HELD:
    296296            raise errors.InvalidJobStateException(self.state)
    297297        self.verify_document(document)
     
    357357        """Blocking cancel. The job must not have been previously
    358358        aborted or completed (though this method will succeed if it
    359         was previously cancelled).  This should be used to stop the
     359        was previously canceled).  This should be used to stop the
    360360        job following an external request.
    361361
     
    371371            self.player.mplayer_stop()
    372372
    373         elif self.is_done and not self._why_done == "cancelled":
    374             raise errors.InvalidJobStateException(self.state)
    375 
    376         logger.info("cancelled job %s" % str(self))
    377         self._why_done = "cancelled"
     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"
    378378
    379379    def abort(self):
    380380        """Blocking abort. The job must not have been previously
    381         cancelled or completed (though this method will succeed if it
     381        canceled or completed (though this method will succeed if it
    382382        was previously aborted).  This should be used to stop the job
    383383        following internal errors.
Note: See TracChangeset for help on using the changeset viewer.