Changeset 6c60b2e


Ignore:
Timestamp:
Jan 21, 2012, 6:25:33 PM (12 years ago)
Author:
Daniel Cooper <danny@…>
Branches:
no-cups
Children:
0494098, 079ef11
Parents:
7f1098c
git-author:
Daniel Cooper <danny@…> (01/21/12 18:25:33)
git-committer:
Daniel Cooper <danny@…> (01/21/12 18:25:33)
Message:

completed print_job function definition in request.py

File:
1 edited

Legend:

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

    rf70792f r6c60b2e  
    125125    @handler_for(ipp.OperationCodes.PRINT_JOB)
    126126    def print_job(self, request, response):
    127         """RFC 2911: 3.2.1 Print-Job Operation
     127            """RFC 2911: 3.2.1 Print-Job Operation
    128128
    129129        This REQUIRED operation allows a client to submit a print job
     
    199199        # get attributes from the printer and add to response
    200200        job_id = self.printer.create_job(
    201             requesting_user_name=requesting_user_name,
     201            requesting_user_name=user_name,
    202202            job_name=job_name,
    203203            job_k_octets=job_k_octets)
     
    208208        # Get nescessary information for calling send_document
    209209        # Any field being set to None here just means that we either aren't using or haven't implemented parsing it
    210         document = request.attribute_groups[2]
     210        document = request.data       
    211211        #XXX
    212212        document_format = None
     
    218218       
    219219        # Actually put the document in the job
    220         self.printer.send_document(job_id,document,
     220        try:
     221            self.printer.send_document(job_id,document,
     222                    document_name = document_name,
     223                    document_format = document_format,
     224                    document_natural_language = document_natural_language,
     225                    requesting_user_name = requesting_user_name,
     226                    compression = compression,
     227                    last_document = last_document)
     228        except InvalidJobException:
     229            raise ipp.errors.ClientErrorNotFound("bad job: %d" % job_id)
     230
     231       
     232        # Print the job, now that we've filled it in as appropriate
     233       
     234       #XXX
     235       #Should we be handling a possible exception here?
     236        self.print_job(document,
    221237                document_name = document_name,
    222238                document_format = document_format,
    223239                document_natural_language = document_natural_language,
    224240                requesting_user_name = requesting_user_name,
    225                 compression = compression,
    226                 last_document = last_document)
    227         #fix this once jess pushes
    228         self.print_job()
     241                compression=compression,
     242                job_name = job_name,
     243                job_k_octets = job_k_octets)
     244
     245        attrs = self.printer.get_job_attributes(job_id)
     246        response.attribute_groups.append(ipp.AttributeGroup(ipp.AttributeTags.JOB, attrs))
     247
    229248    @handler_for(ipp.OperationCodes.VALIDATE_JOB)
    230249    def validate_job(self, request, response):
Note: See TracChangeset for help on using the changeset viewer.