- Timestamp:
- Dec 23, 2011, 8:20:29 PM (12 years ago)
- Branches:
- no-cups
- Children:
- b828a96
- Parents:
- f6e2532
- git-author:
- Jessica B. Hamrick <jhamrick@…> (12/23/11 20:20:29)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (12/23/11 20:20:29)
- Location:
- server/lib/gutenbach
- Files:
-
- 5 added
- 7 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
server/lib/gutenbach/ipp/__init__.py
rf6e2532 raded2d1 1 __all__ = [] 2 1 3 from attribute import Attribute 4 __all__.append('Attribute') 5 2 6 from attributegroup import AttributeGroup 7 __all__.append('AttributeGroup') 8 3 9 from request import Request 10 __all__.append('Request') 11 4 12 from value import Value 13 __all__.append('Value') 5 14 6 15 import constants 7 16 from constants import * 17 __all__.append('constants') 18 __all__.extend(constants.__all__) 8 19 9 20 import exceptions as errors 21 __all__.append('errors') 22 23 import object_attributes 24 from object_attributes import * 25 __all__.append('object_attributes') 26 __all__.extend(object_attributes.__all__) 10 27 11 28 # this import needs to come last 12 import operations as ops 13 14 __all__ = ['Attribute', 'AttributeGroup', 'Request', 'Value', 15 'ops', 'errors', 'constants'] 16 __all__.extend(constants.__all__) 29 import operations as ops 30 __all__.append('ops') -
server/lib/gutenbach/ipp/constants.py
rf6e2532 raded2d1 15 15 'OctetStringTags', 16 16 'CharacterStringTags', 17 'operations_attribute_value_tags',18 'job_attribute_value_tags',19 'printer_attribute_value_tags',20 17 ] 21 18 … … 331 328 MIME_MEDIA_TYPE = 0x49 332 329 MEMBER_ATTR_NAME = 0x4a 333 334 operations_attribute_value_tags = {335 'attributes-charset': CharacterStringTags.CHARSET,336 'attributes-natural-language': CharacterStringTags.NATURAL_LANGUAGE,337 'printer-uri': CharacterStringTags.URI,338 'requesting-user-name': CharacterStringTags.NAME_WITHOUT_LANGUAGE339 }340 341 job_attribute_value_tags = {342 'job-id': IntegerTags.INTEGER,343 'job-name': CharacterStringTags.NAME_WITHOUT_LANGUAGE,344 'job-originating-user-name': CharacterStringTags.NAME_WITHOUT_LANGUAGE,345 'job-k-octets': IntegerTags.INTEGER,346 'job-state': IntegerTags.ENUM,347 'job-printer-uri': CharacterStringTags.URI348 }349 350 printer_attribute_value_tags = {351 "printer-uri-supported": CharacterStringTags.URI,352 "uri-authentication-supported": CharacterStringTags.KEYWORD,353 "uri-security-supported": CharacterStringTags.KEYWORD,354 "printer-name": CharacterStringTags.NAME_WITHOUT_LANGUAGE,355 "printer-state": IntegerTags.ENUM,356 "printer-state-reasons": CharacterStringTags.KEYWORD,357 "ipp-versions-supported": CharacterStringTags.KEYWORD,358 "operations-supported": IntegerTags.ENUM,359 "charset-configured": CharacterStringTags.CHARSET,360 "charset-supported": CharacterStringTags.CHARSET,361 "natural-language-configured": CharacterStringTags.NATURAL_LANGUAGE,362 "generated-natural-language-supported": CharacterStringTags.NATURAL_LANGUAGE,363 "document-format-default": CharacterStringTags.MIME_MEDIA_TYPE,364 "document-format-supported": CharacterStringTags.MIME_MEDIA_TYPE,365 "printer-is-accepting-jobs": IntegerTags.BOOLEAN,366 "queued-job-count": IntegerTags.INTEGER,367 "pdl-override-supported": CharacterStringTags.KEYWORD,368 "printer-up-time": IntegerTags.INTEGER,369 "compression-supported": CharacterStringTags.KEYWORD,370 "multiple-operation-time-out": IntegerTags.INTEGER,371 "multiple-document-jobs-supported": IntegerTags.BOOLEAN372 }373 -
server/lib/gutenbach/ipp/errors.py
rf6c6897 raded2d1 2 2 3 3 class IPPException(Exception): 4 def __init__(self, message ):4 def __init__(self, message=""): 5 5 self.message = message 6 6 … … 24 24 ### Client error codes 25 25 26 class BadRequest(IPPClientException):26 class ClientErrorBadRequest(IPPClientException): 27 27 ipp_error_code = ErrorCodes.BAD_REQUEST 28 28 29 class Forbidden(IPPClientException):29 class ClientErrorForbidden(IPPClientException): 30 30 ipp_error_code = ErrorCodes.FORBIDDEN 31 31 32 class NotAuthenticated(IPPClientException):32 class ClientErrorNotAuthenticated(IPPClientException): 33 33 ipp_error_code = ErrorCodes.NOT_AUTHENTICATED 34 34 35 class NotAuthorized(IPPClientException):35 class ClientErrorNotAuthorized(IPPClientException): 36 36 ipp_error_code = ErrorCodes.NOT_AUTHORIZED 37 37 38 class NotPossible(IPPClientException):38 class ClientErrorNotPossible(IPPClientException): 39 39 ipp_error_code = ErrorCodes.NOT_POSSIBLE 40 40 41 class Timeout(IPPClientException):41 class ClientErrorTimeout(IPPClientException): 42 42 ipp_error_code = ErrorCodes.TIMEOUT 43 43 44 class NotFound(IPPClientException):44 class ClientErrorNotFound(IPPClientException): 45 45 ipp_error_code = ErrorCodes.NOT_FOUND 46 46 47 class Gone(IPPClientException):47 class ClientErrorGone(IPPClientException): 48 48 ipp_error_code = ErrorCodes.GONE 49 49 50 class RequestEntity(IPPClientException):50 class ClientErrorRequestEntity(IPPClientException): 51 51 ipp_error_code = ErrorCodes.REQUEST_ENTITY 52 52 53 class RequestValue(IPPClientException):53 class ClientErrorRequestValue(IPPClientException): 54 54 ipp_error_code = ErrorCodes.REQUEST_VALUE 55 55 56 class DocumentFormatNotSupported(IPPClientException):56 class ClientErrorDocumentFormatNotSupported(IPPClientException): 57 57 ipp_error_code = ErrorCodes.DOCUMENT_FORMAT 58 58 59 class Attributes(IPPClientException):59 class ClientErrorAttributes(IPPClientException): 60 60 ipp_error_code = ErrorCodes.ATTRIBUTES 61 61 … … 67 67 pass 68 68 69 class UriSchemeNotSupported(IPPClientException):69 class ClientErrorUriSchemeNotSupported(IPPClientException): 70 70 ipp_error_code = ErrorCodes.URI_SCHEME 71 71 72 class C harsetNotSupported(IPPClientException):72 class ClientErrorCharsetNotSupported(IPPClientException): 73 73 ipp_error_code = ErrorCodes.CHARSET 74 74 75 class C onflict(IPPClientException):75 class ClientErrorConflict(IPPClientException): 76 76 ipp_error_code = ErrorCodes.CONFLICT 77 77 78 class C ompressionNotSupported(IPPClientException):78 class ClientErrorCompressionNotSupported(IPPClientException): 79 79 ipp_error_code = ErrorCodes.COMPRESSION_NOT_SUPPORTED 80 80 81 class C ompressionError(IPPClientException):81 class ClientErrorCompressionError(IPPClientException): 82 82 ipp_error_code = ErrorCodes.COMPRESSION_ERROR 83 83 84 class DocumentFormatError(IPPClientException):84 class ClientErrorDocumentFormatError(IPPClientException): 85 85 ipp_error_code = ErrorCodes.DOCUMENT_FORMAT_ERROR 86 86 87 class DocumentAccessError(IPPClientException):87 class ClientErrorDocumentAccessError(IPPClientException): 88 88 ipp_error_code = ErrorCodes.DOCUMENT_ACCESS_ERROR 89 89 90 class AttributesNotSettable(IPPClientException):90 class ClientErrorAttributesNotSettable(IPPClientException): 91 91 ipp_error_code = ErrorCodes.ATTRIBUTES_NOT_SETTABLE 92 92 93 class IgnoredAllSubscriptions(IPPClientException):93 class ClientErrorIgnoredAllSubscriptions(IPPClientException): 94 94 ipp_error_code = ErrorCodes.IGNORED_ALL_SUBSCRIPTIONS 95 95 96 class TooManySubscriptions(IPPClientException):96 class ClientErrorTooManySubscriptions(IPPClientException): 97 97 ipp_error_code = ErrorCodes.TOO_MANY_SUBSCRIPTIONS 98 98 99 class IgnoredAllNotifications(IPPClientException):99 class ClientErrorIgnoredAllNotifications(IPPClientException): 100 100 ipp_error_code = ErrorCodes.IGNORED_ALL_NOTIFICATIONS 101 101 102 class PrintSupportFileNotFound(IPPClientException):102 class ClientErrorPrintSupportFileNotFound(IPPClientException): 103 103 ipp_error_code = ErrorCodes.PRINT_SUPPORT_FILE_NOT_FOUND 104 104 105 105 ### Server error codes 106 106 107 class InternalError(IPPServerException):107 class ServerErrorInternalError(IPPServerException): 108 108 ipp_error_code = ErrorCodes.INTERNAL_ERROR 109 109 110 class OperationNotSupported(IPPServerException):110 class ServerErrorOperationNotSupported(IPPServerException): 111 111 ipp_error_code = ErrorCodes.OPERATION_NOT_SUPPORTED 112 112 113 class Serv iceUnavailable(IPPServerException):113 class ServerErrorServiceUnavailable(IPPServerException): 114 114 ipp_error_code = ErrorCodes.SERVICE_UNAVAILABLE 115 115 116 class VersionNotSupported(IPPServerException):116 class ServerErrorVersionNotSupported(IPPServerException): 117 117 ipp_error_code = ErrorCodes.VERSION_NOT_SUPPORTED 118 118 119 class DeviceError(IPPServerException):119 class ServerErrorDeviceError(IPPServerException): 120 120 ipp_error_code = ErrorCodes.DEVICE_ERROR 121 121 122 class TemporaryError(IPPServerException):122 class ServerErrorTemporaryError(IPPServerException): 123 123 ipp_error_code = ErrorCodes.TEMPORARY_ERROR 124 124 125 class NotAccepting(IPPServerException):125 class ServerErrorNotAccepting(IPPServerException): 126 126 ipp_error_code = ErrorCodes.NOT_ACCEPTING 127 127 128 class PrinterBusy(IPPServerException):128 class ServerErrorPrinterBusy(IPPServerException): 129 129 ipp_error_code = ErrorCodes.PRINTER_BUSY 130 130 131 class ErrorJobCancelled(IPPServerException):131 class ServerErrorErrorJobCancelled(IPPServerException): 132 132 ipp_error_code = ErrorCodes.ERROR_JOB_CANCELLED 133 133 134 class MultipleJobsNotSupported(IPPServerException):134 class ServerErrorMultipleJobsNotSupported(IPPServerException): 135 135 ipp_error_code = ErrorCodes.MULTIPLE_JOBS_NOT_SUPPORTED 136 136 137 class PrinterIsDeactivated(IPPServerException):137 class ServerErrorPrinterIsDeactivated(IPPServerException): 138 138 ipp_error_code = ErrorCodes.PRINTER_IS_DEACTIVATED -
server/lib/gutenbach/ipp/operations/__init__.py
re70c020 raded2d1 5 5 from .. import errors 6 6 from .. import constants as consts 7 from .. import object_attributes 7 8 8 9 def verify_operations(request): … … 16 17 # XXX: check version 17 18 if False: 18 raise errors. VersionNotSupported(str(request.version))19 raise errors.ClientErrorVersionNotSupported(str(request.version)) 19 20 20 21 # XXX: check operation id 21 22 if False: 22 raise errors. OperationNotSupported(str(request.operation_id))23 raise errors.ClientErrorOperationNotSupported(str(request.operation_id)) 23 24 24 25 # check operation attributes tag 25 26 op_attrs = request.attribute_groups[0] 26 27 if op_attrs.tag != consts.AttributeTags.OPERATION: 27 raise errors. BadRequest(28 raise errors.ClientErrorBadRequest( 28 29 "Attribute group does not have OPERATION tag: 0x%x" % op_attrs.tag) 29 30 … … 32 33 # # check compression 33 34 # if False: 34 # raise errors.C ompressionNotSupported35 # raise errors.ClientErrorCompressionNotSupported 35 36 36 37 # # check document format 37 38 # if False: 38 # raise errors. DocumentFormatNotSupported39 # raise errors.ClientErrorDocumentFormatNotSupported 39 40 40 41 # # check document uri 41 42 # if False: 42 # raise errors. UriSchemeNotSupported43 # raise errors.ClientErrorUriSchemeNotSupported 43 44 44 45 # check charset 45 46 charset_attr = op_attrs.attributes[0] 46 if charset_attr.name != 'attributes-charset': 47 raise errors.BadRequest( 48 "Attribute is not attributes-charset: %s" % charset_attr.name) 49 if len(charset_attr.values) != 1: 50 raise errors.BadRequest( 51 "Too many values for attributes-charset: %d" % len(charset_attr.values)) 52 # check charset value 53 charset_value = charset_attr.values[0] 54 if charset_value.tag != consts.operations_attribute_value_tags['attributes-charset']: 55 raise errors.BadRequest( 56 "Wrong tag for charset value: 0x%x" % charset_value.tag) 57 if charset_value.value != 'utf-8': 58 raise errors.CharsetNotSupported(str(charset_value.value)) 47 if charset_attr != object_attributes.AttributesCharset('utf-8'): 48 raise errors.ClientErrorBadRequest 59 49 60 50 # check for attributes-natural-language 61 51 natlang_attr = op_attrs.attributes[1] 62 if natlang_attr.name != 'attributes-natural-language': 63 raise errors.BadRequest( 64 "Attribute is not attributes-natural-language: %s" % natlang_attr.name) 65 if len(charset_attr.values) != 1: 66 raise errors.BadRequest( 67 "Too many values for attributes-natural-language: %s" % len(natlang_attr.values)) 68 # check natural language value 69 natlang_value = natlang_attr.values[0] 70 if natlang_value.tag != consts.operations_attribute_value_tags['attributes-natural-language']: 71 raise errors.BadRequest( 72 "Natural language value does not have NATURAL_LANGUAGE tag: 0x%x" % natlang_value.tag) 73 if natlang_value.value != 'en-us': 74 raise errors.Attributes( 75 "Invalid natural language value: %s" % natlang_value.value, [natlang_attr]) 52 if natlang_attr != object_attributes.AttributesNaturalLanguage('en-us'): 53 raise errors.ClientErrorBadRequest 76 54 77 return dict([(attr.name, attr .values) for attr in op_attrs.attributes])55 return dict([(attr.name, attr) for attr in op_attrs.attributes]) 78 56 79 def verify_printer_uri(values): 80 if len(values) != 1: 81 raise errors.BadRequest( 82 "Requesting printer uri attribute has too many values: %d" % len(values)) 83 uri_value = values[0] 84 if uri_value.tag != consts.operations_attribute_value_tags['printer-uri']: 85 raise errors.BadRequest( 86 "Bad value tag (expected URI): 0x%x" % uri_value_tag) 57 def verify_printer_uri(uri_attr): 58 if uri_attr != object_attributes.PrinterUri(uri_attr.values[0].value): 59 raise errors.ClientErrorBadRequest 87 60 88 61 # actually get the printer name … … 90 63 # we can't do an exact comparison (also the hostname might be 91 64 # different, depending on the CNAME or whether it's localhost) 92 uri = uri_ value.value.split("/")[-1]65 uri = uri_attr.values[0].value.split("/")[-1] 93 66 return uri 94 67 95 def verify_requesting_username(values): 96 if len(values) != 1: 97 raise errors.BadRequest( 98 "Requesting user name attribute has too many values: %d" % len(values)) 99 requser_value = values[0] 100 if requser_value.tag != consts.operations_attribute_value_tags['requesting-user-name']: 101 raise errors.BadRequest( 102 "Bad value tag (expected NAME_WITHOUT_LANGUAGE): 0x%x" % requser_value.tag) 103 104 return requser_value.value 68 def verify_requesting_username(username_attr): 69 if username_attr != object_attributes.RequestingUserName(username_attr.values[0].value): 70 raise errors.ClientErrorBadRequest 71 return username_attr.values[0].value 105 72 106 73 def make_empty_response(request): 107 74 # Operation attributes -- typically the same for any request 108 attributes = [ 109 Attribute( 110 'attributes-charset', 111 [Value(consts.operations_attribute_value_tags['attributes-charset'], 'utf-8')]), 112 Attribute( 113 'attributes-natural-language', 114 [Value(consts.operations_attribute_value_tags['attributes-natural-language'], 115 'en-us')]) 116 ] 117 # Put the operation attributes in a group 118 attribute_group = AttributeGroup( 75 attributes = AttributeGroup( 119 76 consts.AttributeTags.OPERATION, 120 attributes) 77 [object_attributes.AttributesCharset('utf-8'), 78 object_attributes.AttributesNaturalLanguage('en-us')]) 121 79 122 80 # Set up the default response -- handlers will override these … … 126 84 response_kwargs['operation_id'] = consts.StatusCodes.OK 127 85 response_kwargs['request_id'] = request.request_id 128 response_kwargs['attribute_groups'] = [attribute _group]86 response_kwargs['attribute_groups'] = [attributes] 129 87 response = Request(**response_kwargs) 130 88 … … 132 90 133 91 def make_job_attributes(attrs, request, response): 134 ipp_attrs = []135 for attr, vals in attrs:136 ipp_vals = [Value(137 tag=consts.job_attribute_value_tags[attr],138 value=val) for val in vals]139 ipp_attrs.append(Attribute(name=attr, values=ipp_vals))140 92 response.attribute_groups.append(AttributeGroup( 141 consts.AttributeTags.JOB, ipp_attrs))93 consts.AttributeTags.JOB, attrs)) 142 94 143 95 def make_printer_attributes(attrs, request, response): 144 ipp_attrs = []145 for attr, vals in attrs:146 ipp_vals = [Value(147 tag=consts.printer_attribute_value_tags[attr],148 value=val) for val in vals]149 ipp_attrs.append(Attribute(name=attr, values=ipp_vals))150 96 response.attribute_groups.append(AttributeGroup( 151 consts.AttributeTags.PRINTER, ipp_attrs))97 consts.AttributeTags.PRINTER, attrs)) 152 98 153 99 from cups_get_classes import verify_cups_get_classes_request, make_cups_get_classes_response -
server/lib/gutenbach/ipp/operations/get_jobs.py
r5e44432 raded2d1 99 99 # requested printer uri 100 100 if 'printer-uri' not in attrs: 101 raise err. BadRequest("Missing 'printer-uri' attribute")101 raise err.ClientErrorBadRequest("Missing 'printer-uri' attribute") 102 102 out['printer-uri'] = verify_printer_uri(attrs['printer-uri']) 103 103 -
server/lib/gutenbach/server/job.py
r5fe360e raded2d1 1 1 from exceptions import InvalidJobException, InvalidPrinterStateException 2 2 import os 3 import gutenbach.ipp.object_attributes.job_description_attributes as jda 3 4 4 5 # initialize logger … … 50 51 @property 51 52 def job_id(self): 52 return self.jid53 return jda.JobId(self.jid) 53 54 54 55 @property 55 56 def job_name(self): 56 return self.name57 return jda.JobName(self.name) 57 58 58 59 # XXX: we need to actually calculate this! 59 60 @property 60 61 def job_originating_user_name(self): 61 return "jhamrick"62 return jda.JobOriginatingUserName("jhamrick") 62 63 63 64 # XXX: we need to actually calculate this! 64 65 @property 65 66 def job_k_octets(self): 66 return 167 return jda.JobKOctets(1) 67 68 68 69 @property 69 70 def job_state(self): 70 return self.status71 return jda.JobState(self.status) 71 72 72 73 @property 73 74 def job_printer_uri(self): 74 return self.printer.uri75 return jda.JobPrinterUri(self.printer.uri) 75 76 76 77 def get_job_attributes(self, request): 77 attributes = [(attr, getattr(self, attr)) for attr in self.attributes] 78 attributes = map(lambda x: x if isinstance(x, (tuple, list)) else [x], attributes) 78 attributes = [getattr(self, attr) for attr in self.attributes] 79 79 return attributes 80 80 -
server/lib/gutenbach/server/printer.py
rf6e2532 raded2d1 4 4 import gutenbach.ipp as ipp 5 5 import gutenbach.ipp.constants as const 6 import gutenbach.ipp.object_attributes.printer_description_attributes as pda 6 7 import logging 7 8 import time … … 88 89 @property 89 90 def printer_uri_supported(self): 90 return self.uri91 return pda.PrinterUriSupported(self.uri) 91 92 92 93 @property 93 94 def uri_authentication_supported(self): 94 return "none"95 return pda.UriAuthenticationSupported("none") 95 96 96 97 @property 97 98 def uri_security_supported(self): 98 return "none"99 return pda.UriSecuritySupported("none") 99 100 100 101 @property 101 102 def printer_name(self): 102 return self.name103 return pda.PrinterName(self.name) 103 104 104 105 @property 105 106 def printer_state(self): 106 return 3 # idle107 return pda.PrinterState(ipp.constants.PrinterStates.IDLE) 107 108 108 109 @property 109 110 def printer_state_reasons(self): 110 return "none"111 return pda.PrinterStateReasons("none") 111 112 112 113 @property 113 114 def ipp_versions_supported(self): 114 return ("1.0", "1.1")115 return pda.IppVersionsSupported("1.0", "1.1") 115 116 116 117 # XXX: We should query ourself for the supported operations 117 118 @property 118 119 def operations_supported(self): 119 return ipp.Operations.GET_JOBS # get-jobs120 return pda.OperationsSupported(ipp.Operations.GET_JOBS) 120 121 121 122 @property 122 123 def charset_configured(self): 123 return "utf-8"124 return pda.CharsetConfigured("utf-8") 124 125 125 126 @property 126 127 def charset_supported(self): 127 return "utf-8"128 return pda.CharsetSupported("utf-8") 128 129 129 130 @property 130 131 def natural_language_configured(self): 131 return "en-us"132 return pda.NaturalLanguageConfigured("en-us") 132 133 133 134 @property 134 135 def generated_natural_language_supported(self): 135 return "en-us"136 return pda.GeneratedNaturalLanguageSupported("en-us") 136 137 137 138 @property 138 139 def document_format_default(self): 139 return "application/octet-stream"140 return pda.DocumentFormatDefault("application/octet-stream") 140 141 141 142 @property 142 143 def document_format_supported(self): 143 return ("application/octet-stream", "audio/mp3")144 return pda.DocumentFormatSupported("application/octet-stream", "audio/mp3") 144 145 145 146 @property 146 147 def printer_is_accepting_jobs(self): 147 return True148 return pda.PrinterIsAcceptingJobs(True) 148 149 149 150 @property 150 151 def queued_job_count(self): 151 return len(self.active_jobs)152 return pda.QueuedJobCount(len(self.active_jobs)) 152 153 153 154 @property 154 155 def pdl_override_supported(self): 155 return "not-attempted"156 return pda.PdlOverrideSupported("not-attempted") 156 157 157 158 @property 158 159 def printer_up_time(self): 159 return int(time.time()) - self.time_created160 return pda.PrinterUpTime(int(time.time()) - self.time_created) 160 161 161 162 @property 162 163 def compression_supported(self): 163 return "none"164 return pda.CompressionSupported("none") 164 165 165 166 @property 166 167 def multiple_operation_time_out(self): 167 return 240168 return pda.MultipleOperationTimeOut(240) 168 169 169 170 @property 170 171 def multiple_document_jobs_supported(self): 171 return False172 return pda.MultipleDocumentJobsSupported(False) 172 173 173 174 def get_printer_attributes(self, request): 174 attributes = [(attr, getattr(self, attr)) for attr in self.attributes] 175 attributes = map(lambda x: x if isinstance(x[1], (tuple, list)) else (x[0], [x[1]]), 176 attributes) 175 attributes = [getattr(self, attr) for attr in self.attributes] 177 176 return attributes 178 177 -
server/lib/gutenbach/server/requests.py
r94a4825 raded2d1 4 4 import logging 5 5 import traceback 6 import sys 6 7 7 8 # initialize logger … … 114 115 printer_name = req_dict['printer-uri'] 115 116 if printer_name not in self.printers: 116 raise ipp.errors. Attributes(117 raise ipp.errors.ClientErrorAttributes( 117 118 "Invalid printer uri: %s" % printer_name, 118 119 [request.attribute_groups[0].attributes[2]]) … … 240 241 printer_name = req_dict['printer-uri'] 241 242 if printer_name not in self.printers: 242 raise ipp.errors. Attributes(243 raise ipp.errors.ClientErrorAttributes( 243 244 "Invalid printer uri: %s" % printer_name, 244 245 [request.attribute_groups[0].attributes[2]]) … … 276 277 printer_name = req_dict['printer-uri'] 277 278 if printer_name not in self.printers: 278 raise ipp.errors. Attributes(279 raise ipp.errors.ClientErrorAttributes( 279 280 "Invalid printer uri: %s" % printer_name, 280 281 [request.attribute_groups[0].attributes[2]]) … … 284 285 try: job = self.printers[printer_name].get_job(job_id) 285 286 except InvalidJobException: 286 raise ipp.errors. Attributes(287 raise ipp.errors.ClientErrorAttributes( 287 288 "Invalid job id: %d" % job_id, 288 289 [request.attribute_groups[0].attributes[2]]) # XXX: this is wrong
Note: See TracChangeset
for help on using the changeset viewer.