Ignore:
Timestamp:
Jan 11, 2012, 12:51:51 AM (12 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
no-cups
Children:
be6ff03
Parents:
ffbe41d
git-author:
Jessica B. Hamrick <jhamrick@…> (01/11/12 00:51:51)
git-committer:
Jessica B. Hamrick <jhamrick@…> (01/11/12 00:51:51)
Message:

Clean up printer, job, and requests code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach/ipp/core/errors.py

    r1037115 rb01b6d1  
    4343   
    4444
    45 from .constants import ErrorCodes
     45from .constants import ErrorCodes, AttributeTags
     46from .attributegroup import AttributeGroup
    4647
    4748class IPPException(Exception):
     
    106107    def __init__(self, message, attrs):
    107108        self.message = message
    108         self.bad_attrs = attrs
     109        if hasattr(attrs, '__iter__'):
     110            self.bad_attrs = attrs
     111        else:
     112            self.bad_attrs = [attrs]
    109113
    110114    def update_response(self, response):
    111         pass
     115        super(ClientErrorAttributes, self).update_response(response)
     116        response.attribute_groups.append(
     117            AttributeGroup(
     118                AttributeTags.UNSUPPORTED,
     119                self.bad_attrs))
    112120
    113121class ClientErrorUriSchemeNotSupported(IPPClientException):
Note: See TracChangeset for help on using the changeset viewer.