Changeset 6ed9d7a for server


Ignore:
Timestamp:
Dec 20, 2011, 9:28:12 AM (12 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
no-cups
Children:
1a63bf7
Parents:
35f7259
git-author:
Jessica B. Hamrick <jhamrick@…> (12/20/11 09:28:12)
git-committer:
Jessica B. Hamrick <jhamrick@…> (12/20/11 09:28:12)
Message:

Add make_get_jobs_response to ipp/operations, add documentation to server/requests

Location:
server/lib/gutenbach
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach/ipp/operations.py

    r35f7259 r6ed9d7a  
    180180
    181181    return out
     182
     183def make_get_jobs_response(self, request):
     184    """3.2.6.2 Get-Jobs Response
     185       
     186    The Printer object returns all of the Job objects up to the number
     187    specified by the 'limit' attribute that match the criteria as
     188    defined by the attribute values supplied by the client in the
     189    request. It is possible that no Job objects are returned since
     190    there may literally be no Job objects at the Printer, or there may
     191    be no Job objects that match the criteria supplied by the
     192    client. If the client requests any Job attributes at all, there is
     193    a set of Job Object Attributes returned for each Job object.
     194
     195    It is not an error for the Printer to return 0 jobs. If the
     196    response returns 0 jobs because there are no jobs matching the
     197    criteria, and the request would have returned 1 or more jobs
     198    with a status code of ’successful-ok’ if there had been jobs
     199    matching the criteria, then the status code for 0 jobs MUST be
     200    ’successful-ok’.
     201
     202    Group 1: Operation Attributes
     203        Status Message:
     204            In addition to the REQUIRED status code returned in
     205            every response, the response OPTIONALLY includes a
     206            'status-message' (text(255)) and/or a
     207            'detailed-status-message' (text(MAX)) operation
     208            attribute as described in sections 13 and 3.1.6.
     209        Natural Language and Character Set:
     210            The 'attributes-charset' and
     211            'attributes-natural-language' attributes as described
     212            in section 3.1.4.2.
     213
     214    Group 2: Unsupported Attributes
     215        See section 3.1.7 for details on returning Unsupported
     216        Attributes.  The response NEED NOT contain the
     217        'requested-attributes' operation attribute with any
     218        supplied values (attribute keywords) that were requested
     219        by the client but are not supported by the IPP object.  If
     220        the Printer object does return unsupported attributes
     221        referenced in the 'requested-attributes' operation
     222        attribute and that attribute included group names, such as
     223        ’all’, the unsupported attributes MUST NOT include
     224        attributes described in the standard but not supported by
     225        the implementation.
     226
     227    Groups 3 to N: Job Object Attributes
     228        The Printer object responds with one set of Job Object
     229        Attributes for each returned Job object. The Printer
     230        object ignores (does not respond with) any requested
     231        attribute or value which is not supported or which is
     232        restricted by the security policy in force, including
     233        whether the requesting user is the user that submitted the
     234        job (job originating user) or not (see section
     235        8). However, the Printer object MUST respond with the
     236        ’unknown’ value for any supported attribute (including all
     237        REQUIRED attributes) for which the Printer object does not
     238        know the value, unless it would violate the security
     239        policy. See the description of the 'out-of- band' values
     240        in the beginning of Section 4.1.
     241
     242        Jobs are returned in the following order:
     243        - If the client requests all ’completed’ Jobs (Jobs in the
     244          ’completed’, ’aborted’, or ’canceled’ states), then the
     245          Jobs are returned newest to oldest (with respect to
     246          actual completion time)
     247        - If the client requests all ’not-completed’ Jobs (Jobs in
     248          the ’pending’, ’processing’, ’pending-held’, and
     249          ’processing- stopped’ states), then Jobs are returned in
     250          relative chronological order of expected time to
     251          complete (based on whatever scheduling algorithm is
     252          configured for the Printer object).
     253
     254    """
     255
     256    pass
  • server/lib/gutenbach/server/requests.py

    r738d179 r6ed9d7a  
    100100    @handler_for(const.Operations.GET_JOBS)
    101101    def get_jobs(self, request, response):
     102        """RFC 2911: 3.2.6 Get-Jobs Operation
     103       
     104        This REQUIRED operation allows a client to retrieve the list
     105        of Job objects belonging to the target Printer object. The
     106        client may also supply a list of Job attribute names and/or
     107        attribute group names. A group of Job object attributes will
     108        be returned for each Job object that is returned.
     109
     110        This operation is similar to the Get-Job-Attributes operation,
     111        except that this Get-Jobs operation returns attributes from
     112        possibly more than one object.
     113
     114        """
     115
    102116        printer_name = self._get_printer_name(request)
    103117        # Each job will append a new job attribute group.
     
    155169    def promote_job(self, request, response):
    156170        pass
    157 
    158171
    159172    ##### CUPS Specific Commands
Note: See TracChangeset for help on using the changeset viewer.