Ignore:
Timestamp:
Jan 11, 2012, 6:58:43 PM (12 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
no-cups
Children:
09790fe
Parents:
4126d3d
git-author:
Jessica B. Hamrick <jhamrick@…> (01/11/12 18:58:43)
git-committer:
Jessica B. Hamrick <jhamrick@…> (01/11/12 18:58:43)
Message:

Keep IPP code in GutenbachPrinter?, not in GutenbachJob?

File:
1 edited

Legend:

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

    r34a4e5d r33ea505  
    258258           
    259259        # get the job attributes and add them to the response
    260         jobs = self.printer.get_jobs(
     260        job_attrs = self.printer.get_jobs(
    261261            which_jobs=which_jobs,
    262             requesting_user_name=user)
    263         for job in jobs:
    264             attrs = job.get_job_attributes(requested_attributes=attributes)
     262            requesting_user_name=user,
     263            requested_attributes=attributes)
     264        for attrs in job_attrs:
    265265            response.attribute_groups.append(ipp.AttributeGroup(
    266266                ipp.AttributeTags.JOB, attrs))
     
    354354
    355355        # get attributes from the printer and add to response
    356         job = self.printer.create_job(
     356        job_id = self.printer.create_job(
    357357            requesting_user_name=requesting_user_name,
    358358            job_name=job_name,
    359359            job_k_octets=job_k_octets)
     360        attrs = self.printer.get_job_attributes(job_id)
    360361        response.attribute_groups.append(ipp.AttributeGroup(
    361             ipp.AttributeTags.JOB, job.get_job_attributes()))
     362            ipp.AttributeTags.JOB, attrs))
    362363   
    363364    @handler_for(ipp.OperationCodes.PAUSE_PRINTER)
     
    536537
    537538        if 'requesting-user-name' in operation:
    538             user_name = verify_attribute(
     539            requesting_user_name = verify_attribute(
    539540                operation['requesting-user-name'], ipp.RequestingUserName)[0]
    540541
    541542        try:
    542             job = self.printer.get_job(job_id)
    543             job.cancel()
     543            self.printer.cancel_job(job_id, requesting_user_name=requesting_user_name)
    544544        except InvalidJobException:
    545545            raise ipp.errors.ClientErrorNotFound("bad job: %d" % job_id)
     
    681681
    682682        try:
    683             job = self.printer.get_job(job_id)
    684             job.send_document(
     683            self.printer.send_document(
     684                job_id,
    685685                request.data,
    686                 requesting_user_name=user_name,
    687686                document_name=document_name,
    688                 compression=compression,
    689687                document_format=document_format,
    690688                document_natural_language=document_natural_language,
     689                requesting_user_name=user_name,
     690                compression=compression,
    691691                last_document=last_document)
    692             attrs = job.get_job_attributes()
     692            attrs = self.printer.get_job_attributes(job_id)
    693693        except InvalidJobException:
    694694            raise ipp.errors.ClientErrorNotFound("bad job: %d" % job_id)
     
    796796        # get the job attributes and add them to the response
    797797        try:
    798             job = self.printer.get_job(job_id)
    799             attrs = job.get_job_attributes(requested_attributes=requested_attributes)
     798            attrs = self.printer.get_job_attributes(
     799                job_id,
     800                requested_attributes=requested_attributes)
    800801        except InvalidJobException:
    801802            raise ipp.errors.ClientErrorNotFound("bad job: %d" % job_id)
Note: See TracChangeset for help on using the changeset viewer.