Ignore:
Timestamp:
Dec 23, 2011, 8:20:29 PM (12 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
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)
Message:

Checkpoint, creating classes for specific IPP attributes

File:
1 edited

Legend:

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

    r5fe360e raded2d1  
    11from exceptions import InvalidJobException, InvalidPrinterStateException
    22import os
     3import gutenbach.ipp.object_attributes.job_description_attributes as jda
    34
    45# initialize logger
     
    5051    @property
    5152    def job_id(self):
    52         return self.jid
     53        return jda.JobId(self.jid)
    5354
    5455    @property
    5556    def job_name(self):
    56         return self.name
     57        return jda.JobName(self.name)
    5758
    5859    # XXX: we need to actually calculate this!
    5960    @property
    6061    def job_originating_user_name(self):
    61         return "jhamrick"
     62        return jda.JobOriginatingUserName("jhamrick")
    6263
    6364    # XXX: we need to actually calculate this!
    6465    @property
    6566    def job_k_octets(self):
    66         return 1
     67        return jda.JobKOctets(1)
    6768
    6869    @property
    6970    def job_state(self):
    70         return self.status
     71        return jda.JobState(self.status)
    7172
    7273    @property
    7374    def job_printer_uri(self):
    74         return self.printer.uri
     75        return jda.JobPrinterUri(self.printer.uri)
    7576
    7677    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]
    7979        return attributes
    8080   
Note: See TracChangeset for help on using the changeset viewer.