Changeset aded2d1 for server/lib/gutenbach/server/job.py
- Timestamp:
- Dec 23, 2011, 8:20:29 PM (12 years ago)
- Branches:
- no-cups
- Children:
- b828a96
- Parents:
- f6e2532
- git-author:
- Jessica B. Hamrick <jhamrick@…> (12/23/11 20:20:29)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (12/23/11 20:20:29)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/lib/gutenbach/server/job.py
r5fe360e raded2d1 1 1 from exceptions import InvalidJobException, InvalidPrinterStateException 2 2 import os 3 import gutenbach.ipp.object_attributes.job_description_attributes as jda 3 4 4 5 # initialize logger … … 50 51 @property 51 52 def job_id(self): 52 return self.jid53 return jda.JobId(self.jid) 53 54 54 55 @property 55 56 def job_name(self): 56 return self.name57 return jda.JobName(self.name) 57 58 58 59 # XXX: we need to actually calculate this! 59 60 @property 60 61 def job_originating_user_name(self): 61 return "jhamrick"62 return jda.JobOriginatingUserName("jhamrick") 62 63 63 64 # XXX: we need to actually calculate this! 64 65 @property 65 66 def job_k_octets(self): 66 return 167 return jda.JobKOctets(1) 67 68 68 69 @property 69 70 def job_state(self): 70 return self.status71 return jda.JobState(self.status) 71 72 72 73 @property 73 74 def job_printer_uri(self): 74 return self.printer.uri75 return jda.JobPrinterUri(self.printer.uri) 75 76 76 77 def get_job_attributes(self, request): 77 attributes = [(attr, getattr(self, attr)) for attr in self.attributes] 78 attributes = map(lambda x: x if isinstance(x, (tuple, list)) else [x], attributes) 78 attributes = [getattr(self, attr) for attr in self.attributes] 79 79 return attributes 80 80
Note: See TracChangeset
for help on using the changeset viewer.