Changeset 4ec7caa for server/lib/ipp.py


Ignore:
Timestamp:
Nov 6, 2010, 4:27:10 PM (14 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
no-cups
Children:
d56a0bc
Parents:
84e8137
git-author:
Jessica B. Hamrick <jhamrick@…> (11/06/10 16:27:10)
git-committer:
Jessica B. Hamrick <jhamrick@…> (11/06/10 16:27:10)
Message:

Add some comments to ipp.py; use struct module in ipprequest.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/lib/ipp.py

    rc216863 r4ec7caa  
    1313import ipplib
    1414
    15 from ipplib import IPPRequest
     15from ipprequest import IPPRequest
    1616from tempfile import mkstemp
    1717from shutil import move
     
    3939    # nothing to do in the init
    4040    def __init__(self):
     41        """
     42        This function doesn't actually do anything.
     43        """
    4144        pass
    4245
    4346    # this function processes an IPP request and sends a response
    4447    def process(self, request_in, response_out):
     48        """
     49        Processes an IPP request and sends a response.
    4550
     51        Arguments:
    4652
     53            request_in -- a file handle to read in the request
     54
     55            request_out -- a file handle to print the response
     56        """
     57       
     58        # parse the request from request_in
     59        request = IPPRequest(request=request_in)
     60
     61        # create the response, copying the version, operation-id, and
     62        # request-id from the request
    4763        response = IPPRequest(version=request.version,
    4864                              operation_id=request.operation_id,
    4965                              request_id=request.request_id)
    50         #file('/mit/gutenbach/tmp/requests/'+str(request.operation_id)).write()
     66       
    5167        handler = getattr(self, "_operation_%d" % request.operation_id, None)
    5268
Note: See TracChangeset for help on using the changeset viewer.