Changeset e58af05 for server/lib/gutenbach/server/job.py
- Timestamp:
- Dec 27, 2011, 11:33:55 PM (12 years ago)
- Branches:
- no-cups
- Children:
- ce2abc5
- Parents:
- 7c143c9
- git-author:
- Jessica B. Hamrick <jhamrick@…> (12/27/11 23:33:55)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (12/27/11 23:33:55)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/lib/gutenbach/server/job.py
ree8e6d0 re58af05 1 from exceptionsimport InvalidJobException, InvalidPrinterStateException1 from . import InvalidJobException, InvalidPrinterStateException 2 2 import os 3 3 import gutenbach.ipp as ipp … … 24 24 This sets the status to 'initializing' and optionally sets the 25 25 document to print to the value of document. 26 26 27 """ 27 28 … … 33 34 self.size = size 34 35 35 self.status = ipp.JobStates.PENDING 36 self.document = None 37 self.document_name = None 38 39 self.status = ipp.JobStates.HELD 36 40 37 41 def __getattr__(self, attr): … … 92 96 93 97 def play(self): 94 if self.status != 'active': 95 raise InvalidJobException( 96 "Cannot play an inactive job!") 97 98 self.status = const.JobStates.PROCESSING 98 logger.info("playing job %s" % str(self)) 99 99 # TODO: add external call to music player 100 print "Playing job %s" % str(self) 100 self.status = ipp.JobStates.PROCESSING 101 101 self.printer.complete_job(self.jid) 102 102 103 103 def finish(self): 104 self.status = const.JobStates.COMPLETE 104 logger.info("finished job %s" % str(self)) 105 self.status = ipp.JobStates.COMPLETE 105 106 106 107 def __repr__(self):
Note: See TracChangeset
for help on using the changeset viewer.