Changeset 3cb6c7b


Ignore:
Timestamp:
Jan 21, 2012, 9:49:00 PM (12 years ago)
Author:
Daniel Cooper <danny@…>
Branches:
no-cups
Children:
d42236e
Parents:
b77e57e
git-author:
Daniel Cooper <danny@…> (01/21/12 21:49:00)
git-committer:
Daniel Cooper <danny@…> (01/21/12 21:49:00)
Message:

added more request handlers

File:
1 edited

Legend:

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

    rb77e57e r3cb6c7b  
    683683   
    684684    """
    685         raise ipp.errors.ServerErrorOperationNotSupported
     685    operation = request.attribute_groups[0]
     686    printer_uri = None
     687    user_name   = None
     688    if 'printer-uri' not in operation:
     689            raise ipp.errors.ClientErrorBadRequest("Missing 'printer-uri' attribute")
     690        printer_uri = verify_attribute(operation['printer-uri'], ipp.PrinterUri)[0]
     691        if printer_uri not in self.printer.uris:
     692            raise ipp.errors.ClientErrorAttributes(
     693                str(operation['printer-uri']), operation['printer-uri'])
     694
     695    if 'requesting-user-name' in operation:
     696        user_name = verify_attribute(
     697            operation['requesting-user-name'], ipp.RequestingUserName)[0]
     698   self.printer.pause_printer()
     699
     700
     701    #    raise ipp.errors.ServerErrorOperationNotSupported
    686702
    687703    @handler_for(ipp.OperationCodes.RESUME_PRINTER)
     
    732748        sections 3.2.7.1 and 3.2.7.2).                 
    733749        """
    734         raise ipp.errors.ServerErrorOperationNotSupported
     750    operation = request.attribute_groups[0]
     751    printer_uri = None
     752    user_name   = None
     753    if 'printer-uri' not in operation:
     754            raise ipp.errors.ClientErrorBadRequest("Missing 'printer-uri' attribute")
     755        printer_uri = verify_attribute(operation['printer-uri'], ipp.PrinterUri)[0]
     756        if printer_uri not in self.printer.uris:
     757            raise ipp.errors.ClientErrorAttributes(
     758                str(operation['printer-uri']), operation['printer-uri'])
     759
     760    if 'requesting-user-name' in operation:
     761        user_name = verify_attribute(
     762            operation['requesting-user-name'], ipp.RequestingUserName)[0]
     763   self.printer.resume_printer()
     764
    735765
    736766    @handler_for(ipp.OperationCodes.GET_PRINTER_ATTRIBUTES)
     
    14051435
    14061436        """
    1407 
     1437       
    14081438        raise ipp.errors.ServerErrorOperationNotSupported
    14091439
Note: See TracChangeset for help on using the changeset viewer.