[aded2d1] | 1 | __all__ = [ |
---|
| 2 | 'PrinterUriSupported', |
---|
| 3 | 'UriAuthenticationSupported', |
---|
| 4 | 'UriSecuritySupported', |
---|
| 5 | 'PrinterName', |
---|
| 6 | 'PrinterLocation', |
---|
| 7 | 'PrinterInfo', |
---|
| 8 | 'PrinterMoreInfo', |
---|
| 9 | 'PrinterDriverInstaller', |
---|
| 10 | 'PrinterMakeAndModel', |
---|
| 11 | 'PrinterMoreInfoManufacturer', |
---|
| 12 | 'PrinterState', |
---|
| 13 | 'PrinterStateReasons', |
---|
| 14 | 'PrinterStateMessage', |
---|
| 15 | 'IppVersionsSupported', |
---|
| 16 | 'OperationsSupported', |
---|
| 17 | 'MultipleDocumentJobsSupported', |
---|
| 18 | 'CharsetConfigured', |
---|
| 19 | 'CharsetSupported', |
---|
| 20 | 'NaturalLanguageConfigured', |
---|
| 21 | 'GeneratedNaturalLanguageSupported', |
---|
| 22 | 'DocumentFormatDefault', |
---|
| 23 | 'DocumentFormatSupported', |
---|
| 24 | 'PrinterIsAcceptingJobs', |
---|
| 25 | 'QueuedJobCount', |
---|
| 26 | 'PrinterMessageFromOperator', |
---|
| 27 | 'ColorSupported', |
---|
| 28 | 'ReferenceUriSchemeSupported', |
---|
| 29 | 'PdlOverrideSupported', |
---|
| 30 | 'PrinterUpTime', |
---|
| 31 | 'PrinterCurrentTime', |
---|
| 32 | 'MultipleOperationTimeOut', |
---|
| 33 | 'CompressionSupported', |
---|
| 34 | 'JobKOctetsSupported', |
---|
| 35 | 'JobImpressionsSupported', |
---|
| 36 | 'JobMediaSheetsSupported', |
---|
| 37 | 'PagesPerMinute', |
---|
| 38 | 'PagesPerMinuteColor' |
---|
| 39 | ] |
---|
| 40 | |
---|
| 41 | from ..attribute import Attribute |
---|
| 42 | from ..value import Value |
---|
| 43 | from ..exceptions import ClientErrorAttributes |
---|
| 44 | from ..constants import * |
---|
| 45 | |
---|
[b828a96] | 46 | def PrinterUriSupported(*vals): |
---|
[aded2d1] | 47 | """4.4.1 printer-uri-supported (1setOf uri) |
---|
| 48 | |
---|
| 49 | This REQUIRED Printer attribute contains at least one URI for the |
---|
| 50 | Printer object. It OPTIONALLY contains more than one URI for the |
---|
| 51 | Printer object. |
---|
| 52 | |
---|
| 53 | An administrator determines a Printer object's URI(s) and |
---|
| 54 | configures this attribute to contain those URIs by some means |
---|
| 55 | outside the scope of this IPP/1.1 document. The precise format of |
---|
| 56 | this URI is implementation dependent and depends on the protocol. |
---|
| 57 | See the next two sections for a description of the 'uri-security- |
---|
| 58 | supported' and 'uri-authentication-supported' attributes, both of |
---|
| 59 | which are the REQUIRED companion attributes to this 'printer-uri- |
---|
| 60 | supported' attribute. See section 2.4 on Printer object identity |
---|
| 61 | and section 8.2 on security and URIs for more information. |
---|
| 62 | |
---|
| 63 | """ |
---|
| 64 | |
---|
[b828a96] | 65 | return Attribute( |
---|
| 66 | 'printer-uri-supported', |
---|
| 67 | [Value(CharacterStringTags.URI, val) for val in vals]) |
---|
[aded2d1] | 68 | |
---|
| 69 | |
---|
[b828a96] | 70 | def UriAuthenticationSupported(*vals): |
---|
[aded2d1] | 71 | """4.4.2 uri-authentication-supported (1setOf type2 keyword) |
---|
| 72 | |
---|
| 73 | This REQUIRED Printer attribute MUST have the same cardinality |
---|
| 74 | (contain the same number of values) as the 'printer-uri-supported' |
---|
| 75 | attribute. This attribute identifies the Client Authentication |
---|
| 76 | mechanism associated with each URI listed in the 'printer-uri- |
---|
| 77 | supported' attribute. The Printer object uses the specified |
---|
| 78 | mechanism to identify the authenticated user (see section |
---|
| 79 | 8.3). The 'i th' value in 'uri-authentication-supported' |
---|
| 80 | corresponds to the 'i th' value in 'printer-uri-supported' and it |
---|
| 81 | describes the authentication mechanisms used by the Printer when |
---|
| 82 | accessed via that URI. See [RFC2910] for more details on Client |
---|
| 83 | Authentication. |
---|
| 84 | |
---|
| 85 | """ |
---|
| 86 | |
---|
[b828a96] | 87 | return Attribute( |
---|
| 88 | 'uri-authentication-supported', |
---|
| 89 | [Value(CharacterStringTags.KEYWORD, val) for val in vals]) |
---|
[aded2d1] | 90 | |
---|
[b828a96] | 91 | def UriSecuritySupported(*vals): |
---|
[aded2d1] | 92 | """4.4.3 uri-security-supported (1setOf type2 keyword) |
---|
| 93 | |
---|
| 94 | This REQUIRED Printer attribute MUST have the same cardinality |
---|
| 95 | (contain the same number of values) as the 'printer-uri-supported' |
---|
| 96 | attribute. This attribute identifies the security mechanisms used |
---|
| 97 | for each URI listed in the 'printer-uri-supported' attribute. The |
---|
| 98 | 'i th' value in 'uri-security-supported' corresponds to the 'i th' |
---|
| 99 | value in 'printer-uri-supported' and it describes the security |
---|
| 100 | mechanisms used for accessing the Printer object via that URI. See |
---|
| 101 | [RFC2910] for more details on security mechanisms. |
---|
| 102 | |
---|
| 103 | The following standard keyword values are defined: |
---|
| 104 | 'none': There are no secure communication channel protocols in |
---|
| 105 | use for the given URI. |
---|
| 106 | 'ssl3': SSL3 [SSL] is the secure communications channel |
---|
| 107 | protocol in use for the given URI. |
---|
| 108 | 'tls': TLS [RFC2246] is the secure communications channel |
---|
| 109 | protocol in use for the given URI. |
---|
| 110 | |
---|
| 111 | This attribute is orthogonal to the definition of a Client |
---|
| 112 | Authentication mechanism. Specifically, 'none' does not exclude |
---|
| 113 | Client Authentication. See section 4.4.2. |
---|
| 114 | |
---|
| 115 | """ |
---|
| 116 | |
---|
[b828a96] | 117 | return Attribute( |
---|
| 118 | 'uri-security-supported', |
---|
| 119 | [Value(CharacterStringTags.KEYWORD, val) for val in vals]) |
---|
[aded2d1] | 120 | |
---|
[b828a96] | 121 | def PrinterName(val): |
---|
[aded2d1] | 122 | """4.4.4 printer-name (name(127)) |
---|
| 123 | |
---|
| 124 | This REQUIRED Printer attribute contains the name of the Printer |
---|
| 125 | object. It is a name that is more end-user friendly than a URI. An |
---|
| 126 | administrator determines a printer's name and sets this attribute |
---|
| 127 | to that name. This name may be the last part of the printer's URI |
---|
| 128 | or it may be unrelated. In non-US-English locales, a name may |
---|
| 129 | contain characters that are not allowed in a URI. |
---|
| 130 | |
---|
| 131 | """ |
---|
| 132 | |
---|
[b828a96] | 133 | return Attribute( |
---|
| 134 | 'printer-name', |
---|
| 135 | [Value(CharacterStringTags.NAME_WITHOUT_LANGUAGE, val)]) |
---|
[aded2d1] | 136 | |
---|
[b828a96] | 137 | def PrinterLocation(val): |
---|
[aded2d1] | 138 | """4.4.5 printer-location (text(127)) |
---|
| 139 | |
---|
| 140 | """ |
---|
| 141 | |
---|
[b828a96] | 142 | raise ClientErrorAttributes, "printer-location" |
---|
[aded2d1] | 143 | |
---|
[b828a96] | 144 | def PrinterInfo(val): |
---|
[aded2d1] | 145 | """4.4.6 printer-info (text(127)) |
---|
| 146 | |
---|
| 147 | """ |
---|
| 148 | |
---|
[b828a96] | 149 | raise ClientErrorAttributes, "printer-info" |
---|
[aded2d1] | 150 | |
---|
[b828a96] | 151 | def PrinterMoreInfo(val): |
---|
[aded2d1] | 152 | """4.4.7 printer-more-info (uri) |
---|
| 153 | |
---|
| 154 | """ |
---|
| 155 | |
---|
[b828a96] | 156 | raise ClientErrorAttributes, "printer-more-info" |
---|
[aded2d1] | 157 | |
---|
[b828a96] | 158 | def PrinterDriverInstaller(val): |
---|
[aded2d1] | 159 | """4.4.8 printer-driver-installer (uri) |
---|
| 160 | |
---|
| 161 | """ |
---|
| 162 | |
---|
[b828a96] | 163 | raise ClientErrorAttributes, "printer-driver-installer" |
---|
[aded2d1] | 164 | |
---|
[b828a96] | 165 | def PrinterMakeAndModel(val): |
---|
[aded2d1] | 166 | """4.4.9 printer-make-and-model (text(127)) |
---|
| 167 | |
---|
| 168 | """ |
---|
| 169 | |
---|
[b828a96] | 170 | raise ClientErrorAttributes, "printer-make-and-model" |
---|
[aded2d1] | 171 | |
---|
[b828a96] | 172 | def PrinterMoreInfoManufacturer(val): |
---|
[aded2d1] | 173 | """4.4.10 printer-more-info-manufacturer (uri) |
---|
| 174 | |
---|
| 175 | """ |
---|
| 176 | |
---|
[b828a96] | 177 | raise ClientErrorAttributes, "printer-more-info-manufacturer" |
---|
[aded2d1] | 178 | |
---|
[b828a96] | 179 | def PrinterState(val): |
---|
[aded2d1] | 180 | """4.4.11 printer-state (type1 enum) |
---|
| 181 | |
---|
| 182 | This REQUIRED Printer attribute identifies the current state of |
---|
| 183 | the device. The 'printer-state reasons' attribute augments the |
---|
| 184 | 'printer-state' attribute to give more detailed information about |
---|
| 185 | the Printer in the given printer state. |
---|
| 186 | |
---|
| 187 | A Printer object need only update this attribute before responding |
---|
| 188 | to an operation which requests the attribute; the Printer object |
---|
| 189 | NEED NOT update this attribute continually, since asynchronous |
---|
| 190 | event notification is not part of IPP/1.1. A Printer NEED NOT |
---|
| 191 | implement |
---|
| 192 | |
---|
| 193 | """ |
---|
| 194 | |
---|
[b828a96] | 195 | return Attribute( |
---|
| 196 | 'printer-state', |
---|
| 197 | [Value(IntegerTags.ENUM, val)]) |
---|
[aded2d1] | 198 | |
---|
[b828a96] | 199 | def PrinterStateReasons(*vals): |
---|
[aded2d1] | 200 | """4.4.12 printer-state-reasons (1setOf type2 keyword) |
---|
| 201 | |
---|
| 202 | This REQUIRED Printer attribute supplies additional detail about |
---|
| 203 | the device's state. Some of the these value definitions indicate |
---|
| 204 | conformance requirements; the rest are OPTIONAL. |
---|
| 205 | |
---|
| 206 | Each keyword value MAY have a suffix to indicate its level of |
---|
| 207 | severity. The three levels are: report (least severe), warning, |
---|
| 208 | and error (most severe). |
---|
| 209 | |
---|
| 210 | """ |
---|
| 211 | |
---|
[b828a96] | 212 | return Attribute( |
---|
| 213 | 'printer-state-reasons', |
---|
| 214 | [Value(CharacterStringTags.KEYWORD, val) for val in vals]) |
---|
[aded2d1] | 215 | |
---|
[b828a96] | 216 | def PrinterStateMessage(val): |
---|
[aded2d1] | 217 | """4.4.13 printer-state-message (text(MAX)) |
---|
| 218 | |
---|
| 219 | """ |
---|
| 220 | |
---|
[b828a96] | 221 | raise ClientErrorAttributes, "printer-state-message" |
---|
[aded2d1] | 222 | |
---|
[b828a96] | 223 | def IppVersionsSupported(*vals): |
---|
[aded2d1] | 224 | """4.4.14 ipp-versions-supported (1setOf type2 keyword) |
---|
| 225 | |
---|
| 226 | This REQUIRED attribute identifies the IPP protocol version(s) |
---|
| 227 | that this Printer supports, including major and minor versions, |
---|
| 228 | i.e., the version numbers for which this Printer implementation |
---|
| 229 | meets the conformance requirements. For version number validation, |
---|
| 230 | the Printer matches the (two-octet binary) 'version-number' |
---|
| 231 | parameter supplied by the client in each request (see sections |
---|
| 232 | 3.1.1 and 3.1.8) with the (US-ASCII) keyword values of this |
---|
| 233 | attribute. |
---|
| 234 | |
---|
| 235 | The following standard keyword values are defined: |
---|
| 236 | |
---|
| 237 | '1.0': Meets the conformance requirement of IPP version 1.0 as |
---|
| 238 | specified in RFC 2566 [RFC2566] and RFC 2565 [RFC2565] |
---|
| 239 | including any extensions registered according to Section 6 |
---|
| 240 | and any extension defined in this version or any future |
---|
| 241 | version of the IPP 'Model and Semantics' document or the |
---|
| 242 | IPP 'Encoding and Transport' document following the rules, |
---|
| 243 | if any, when the 'version-number' parameter is '1.0'. |
---|
| 244 | |
---|
| 245 | '1.1': Meets the conformance requirement of IPP version 1.1 as |
---|
| 246 | specified in this document and [RFC2910] including any |
---|
| 247 | extensions registered according to Section 6 and any |
---|
| 248 | extension defined in any future versions of the IPP 'Model |
---|
| 249 | and Semantics' document or the IPP Encoding and Transport |
---|
| 250 | document following the rules, if any, when the |
---|
| 251 | 'version-number' parameter is '1.1'. |
---|
| 252 | |
---|
| 253 | """ |
---|
| 254 | |
---|
[b828a96] | 255 | return Attribute( |
---|
| 256 | 'ipp-versions-supported', |
---|
| 257 | [Value(CharacterStringTags.KEYWORD, val) for val in vals]) |
---|
[aded2d1] | 258 | |
---|
[b828a96] | 259 | def OperationsSupported(*vals): |
---|
[aded2d1] | 260 | """4.4.15 operations-supported (1setOf type2 enum) |
---|
| 261 | |
---|
| 262 | This REQUIRED Printer attribute specifies the set of supported |
---|
| 263 | operations for this Printer object and contained Job objects. |
---|
| 264 | This attribute is encoded as any other enum attribute syntax |
---|
| 265 | according to [RFC2910] as 32-bits. However, all 32-bit enum values |
---|
| 266 | for this attribute MUST NOT exceed 0x00008FFF, since these same |
---|
| 267 | values are also passed in two octets in the 'operation-id' |
---|
| 268 | parameter (see section 3.1.1) in each Protocol request with the |
---|
| 269 | two high order octets omitted in order to indicate the operation |
---|
| 270 | being performed [RFC2910]. |
---|
| 271 | |
---|
| 272 | """ |
---|
| 273 | |
---|
[b828a96] | 274 | return Attribute( |
---|
| 275 | 'operations-supported', |
---|
| 276 | [Value(IntegerTags.ENUM, val) for val in vals]) |
---|
[aded2d1] | 277 | |
---|
[b828a96] | 278 | def MultipleDocumentJobsSupported(val): |
---|
[aded2d1] | 279 | """4.4.16 multiple-document-jobs-supported (boolean) |
---|
| 280 | |
---|
| 281 | This Printer attribute indicates whether or not the Printer |
---|
| 282 | supports more than one document per job, i.e., more than one |
---|
| 283 | Send-Document or Send-Data operation with document data. If the |
---|
| 284 | Printer supports the Create-Job and Send-Document operations (see |
---|
| 285 | section 3.2.4 and 3.3.1), it MUST support this attribute. |
---|
| 286 | |
---|
| 287 | """ |
---|
| 288 | |
---|
[b828a96] | 289 | return Attribute( |
---|
| 290 | 'multiple-document-jobs-supported', |
---|
| 291 | [Value(IntegerTags.BOOLEAN, val)]) |
---|
[aded2d1] | 292 | |
---|
[b828a96] | 293 | def CharsetConfigured(val): |
---|
[aded2d1] | 294 | """4.4.17 charset-configured (charset) |
---|
| 295 | |
---|
| 296 | This REQUIRED Printer attribute identifies the charset that the |
---|
| 297 | Printer object has been configured to represent 'text' and 'name' |
---|
| 298 | Printer attributes that are set by the operator, system |
---|
| 299 | administrator, or manufacturer, i.e., for 'printer-name' (name), |
---|
| 300 | 'printer-location' (text), 'printer-info' (text), and |
---|
| 301 | 'printer-make- and-model' (text). Therefore, the value of the |
---|
| 302 | Printer object's 'charset-configured' attribute MUST also be among |
---|
| 303 | the values of the Printer object's 'charset-supported' attribute. |
---|
| 304 | |
---|
| 305 | """ |
---|
| 306 | |
---|
[b828a96] | 307 | return Attribute( |
---|
| 308 | 'charset-configured', |
---|
| 309 | [Value(CharacterStringTags.CHARSET, val)]) |
---|
[aded2d1] | 310 | |
---|
[b828a96] | 311 | def CharsetSupported(*vals): |
---|
[aded2d1] | 312 | """4.4.18 charset-supported (1setOf charset) |
---|
| 313 | |
---|
| 314 | This REQUIRED Printer attribute identifies the set of charsets |
---|
| 315 | that the Printer and contained Job objects support in attributes |
---|
| 316 | with attribute syntax 'text' and 'name'. At least the value |
---|
| 317 | 'utf-8' MUST be present, since IPP objects MUST support the UTF-8 |
---|
| 318 | [RFC2279] charset. If a Printer object supports a charset, it |
---|
| 319 | means that for all attributes of syntax 'text' and 'name' the IPP |
---|
| 320 | object MUST (1) accept the charset in requests and return the |
---|
| 321 | charset in responses as needed. |
---|
| 322 | |
---|
| 323 | If more charsets than UTF-8 are supported, the IPP object MUST |
---|
| 324 | perform charset conversion between the charsets as described in |
---|
| 325 | Section 3.1.4.2. |
---|
| 326 | |
---|
| 327 | """ |
---|
| 328 | |
---|
[b828a96] | 329 | return Attribute( |
---|
| 330 | 'charset-supported', |
---|
| 331 | [Value(CharacterStringTags.CHARSET, val) for val in vals]) |
---|
[aded2d1] | 332 | |
---|
[b828a96] | 333 | def NaturalLanguageConfigured(val): |
---|
[aded2d1] | 334 | """4.4.19 natural-language-configured (naturalLanguage) |
---|
| 335 | |
---|
| 336 | This REQUIRED Printer attribute identifies the natural language |
---|
| 337 | that the Printer object has been configured to represent 'text' |
---|
| 338 | and 'name' Printer attributes that are set by the operator, system |
---|
| 339 | administrator, or manufacturer, i.e., for 'printer-name' (name), |
---|
| 340 | 'printer-location' (text), 'printer-info' (text), and |
---|
| 341 | 'printer-make- and-model' (text). When returning these Printer |
---|
| 342 | attributes, the Printer object MAY return them in the configured |
---|
| 343 | natural language specified by this attribute, instead of the |
---|
| 344 | natural language requested by the client in the |
---|
| 345 | 'attributes-natural-language' operation attribute. See Section |
---|
| 346 | 3.1.4.1 for the specification of the OPTIONAL multiple natural |
---|
| 347 | language support. Therefore, the value of the Printer object's |
---|
| 348 | 'natural-language-configured' attribute MUST also be among the |
---|
| 349 | values of the Printer object's 'generated-natural- |
---|
| 350 | language-supported' attribute. |
---|
| 351 | |
---|
| 352 | """ |
---|
| 353 | |
---|
[b828a96] | 354 | return Attribute( |
---|
| 355 | 'natural-language-configured', |
---|
| 356 | [Value(CharacterStringTags.NATURAL_LANGUAGE, val)]) |
---|
[aded2d1] | 357 | |
---|
[b828a96] | 358 | def GeneratedNaturalLanguageSupported(*vals): |
---|
[aded2d1] | 359 | """4.4.20 generated-natural-language-supported (1setOf naturalLanguage) |
---|
| 360 | |
---|
| 361 | This REQUIRED Printer attribute identifies the natural language(s) |
---|
| 362 | that the Printer object and contained Job objects support in |
---|
| 363 | attributes with attribute syntax 'text' and 'name'. The natural |
---|
| 364 | language(s) supported depends on implementation and/or |
---|
| 365 | configuration. Unlike charsets, IPP objects MUST accept requests |
---|
| 366 | with any natural language or any Natural Language Override whether |
---|
| 367 | the natural language is supported or not. |
---|
| 368 | |
---|
| 369 | If a Printer object supports a natural language, it means that for |
---|
| 370 | any of the attributes for which the Printer or Job object |
---|
| 371 | generates messages, i.e., for the 'job-state-message' and |
---|
| 372 | 'printer-state- message' attributes and Operation Messages (see |
---|
| 373 | Section 3.1.5) in operation responses, the Printer and Job objects |
---|
| 374 | MUST be able to generate messages in any of the Printer's |
---|
| 375 | supported natural languages. See section 3.1.4 for the definition |
---|
| 376 | of 'text' and 'name' attributes in operation requests and |
---|
| 377 | responses. |
---|
| 378 | |
---|
| 379 | Note: A Printer object that supports multiple natural languages, |
---|
| 380 | often has separate catalogs of messages, one for each natural |
---|
| 381 | language supported. |
---|
| 382 | |
---|
| 383 | """ |
---|
| 384 | |
---|
[b828a96] | 385 | return Attribute( |
---|
| 386 | 'generated-natural-language-supported', |
---|
| 387 | [Value(CharacterStringTags.NATURAL_LANGUAGE, val) for val in vals]) |
---|
[aded2d1] | 388 | |
---|
[b828a96] | 389 | def DocumentFormatDefault(val): |
---|
[aded2d1] | 390 | """4.4.21 document-format-default (mimeMediaType) |
---|
| 391 | |
---|
| 392 | This REQUIRED Printer attribute identifies the document format |
---|
| 393 | that the Printer object has been configured to assume if the |
---|
| 394 | client does not supply a 'document-format' operation attribute in |
---|
| 395 | any of the operation requests that supply document data. The |
---|
| 396 | standard values for this attribute are Internet Media types |
---|
| 397 | (sometimes called MIME types). For further details see the |
---|
| 398 | description of the 'mimeMediaType' attribute syntax in Section |
---|
| 399 | 4.1.9. |
---|
| 400 | |
---|
| 401 | """ |
---|
| 402 | |
---|
[b828a96] | 403 | return Attribute( |
---|
| 404 | 'document-format-default', |
---|
| 405 | [Value(CharacterStringTags.MIME_MEDIA_TYPE, val)]) |
---|
[aded2d1] | 406 | |
---|
[b828a96] | 407 | def DocumentFormatSupported(*vals): |
---|
[aded2d1] | 408 | """4.4.22 document-format-supported (1setOf mimeMediaType) |
---|
| 409 | |
---|
| 410 | This REQUIRED Printer attribute identifies the set of document |
---|
| 411 | formats that the Printer object and contained Job objects can |
---|
| 412 | support. For further details see the description of the |
---|
| 413 | 'mimeMediaType' attribute syntax in Section 4.1.9. |
---|
| 414 | |
---|
| 415 | """ |
---|
| 416 | |
---|
[b828a96] | 417 | return Attribute( |
---|
| 418 | 'document-format-supported', |
---|
| 419 | [Value(CharacterStringTags.MIME_MEDIA_TYPE, val) for val in vals]) |
---|
[aded2d1] | 420 | |
---|
[b828a96] | 421 | def PrinterIsAcceptingJobs(val): |
---|
[aded2d1] | 422 | """4.4.23 printer-is-accepting-jobs (boolean) |
---|
| 423 | |
---|
| 424 | This REQUIRED Printer attribute indicates whether the printer is |
---|
| 425 | currently able to accept jobs, i.e., is accepting Print-Job, |
---|
| 426 | Print- URI, and Create-Job requests. If the value is 'true', the |
---|
| 427 | printer is accepting jobs. If the value is 'false', the Printer |
---|
| 428 | object is currently rejecting any jobs submitted to it. In this |
---|
| 429 | case, the Printer object returns the |
---|
| 430 | 'server-error-not-accepting-jobs' status code. |
---|
| 431 | |
---|
| 432 | This value is independent of the 'printer-state' and |
---|
| 433 | 'printer-state- reasons' attributes because its value does not |
---|
| 434 | affect the current job; rather it affects future jobs. This |
---|
| 435 | attribute, when 'false', causes the Printer to reject jobs even |
---|
| 436 | when the 'printer-state' is 'idle' or, when 'true', causes the |
---|
| 437 | Printer object to accepts jobs even when the 'printer-state' is |
---|
| 438 | 'stopped'. |
---|
| 439 | |
---|
| 440 | """ |
---|
| 441 | |
---|
[b828a96] | 442 | return Attribute( |
---|
| 443 | 'printer-is-accepting-jobs', |
---|
| 444 | [Value(IntegerTags.BOOLEAN, val)]) |
---|
[aded2d1] | 445 | |
---|
[b828a96] | 446 | def QueuedJobCount(val): |
---|
[aded2d1] | 447 | """4.4.24 queued-job-count (integer(0:MAX)) |
---|
| 448 | |
---|
| 449 | This REQUIRED Printer attribute contains a count of the number of |
---|
| 450 | jobs that are either 'pending', 'processing', 'pending-held', or |
---|
| 451 | 'processing-stopped' and is set by the Printer object. |
---|
| 452 | |
---|
| 453 | """ |
---|
| 454 | |
---|
[b828a96] | 455 | return Attribute( |
---|
| 456 | 'queued-job-count', |
---|
| 457 | [Value(IntegerTags.INTEGER, val)]) |
---|
[aded2d1] | 458 | |
---|
[b828a96] | 459 | def PrinterMessageFromOperator(val): |
---|
[aded2d1] | 460 | """4.4.25 printer-message-from-operator (text(127)) |
---|
| 461 | |
---|
| 462 | """ |
---|
| 463 | |
---|
[b828a96] | 464 | raise ClientErrorAttributes, "printer-message-from-operator" |
---|
[aded2d1] | 465 | |
---|
[b828a96] | 466 | def ColorSupported(val): |
---|
[aded2d1] | 467 | """4.4.26 color-supported (boolean) |
---|
| 468 | |
---|
| 469 | """ |
---|
| 470 | |
---|
[b828a96] | 471 | raise ClientErrorAttributes, "color-supported" |
---|
| 472 | |
---|
| 473 | def ReferenceUriSchemeSupported(val): |
---|
[aded2d1] | 474 | """4.4.27 reference-uri-schemes-supported (1setOf uriScheme) |
---|
| 475 | |
---|
| 476 | """ |
---|
| 477 | |
---|
[b828a96] | 478 | raise ClientErrorAttributes, "reference-uri-scheme-supported" |
---|
[aded2d1] | 479 | |
---|
[b828a96] | 480 | def PdlOverrideSupported(val): |
---|
[aded2d1] | 481 | """4.4.28 pdl-override-supported (type2 keyword) |
---|
| 482 | |
---|
| 483 | This REQUIRED Printer attribute expresses the ability for a |
---|
| 484 | particular Printer implementation to either attempt to override |
---|
| 485 | document data instructions with IPP attributes or not. This |
---|
| 486 | attribute takes on the following keyword values: |
---|
| 487 | |
---|
| 488 | - 'attempted': This value indicates that the Printer object |
---|
| 489 | attempts to make the IPP attribute values take precedence over |
---|
| 490 | embedded instructions in the document data, however there is no |
---|
| 491 | guarantee. |
---|
| 492 | |
---|
| 493 | - 'not-attempted': This value indicates that the Printer object |
---|
| 494 | makes no attempt to make the IPP attribute values take |
---|
| 495 | precedence over embedded instructions in the document data. |
---|
| 496 | |
---|
| 497 | Section 15 contains a full description of how this attribute |
---|
| 498 | interacts with and affects other IPP attributes, especially the |
---|
| 499 | 'ipp-attribute-fidelity' attribute. |
---|
| 500 | |
---|
| 501 | """ |
---|
| 502 | |
---|
[b828a96] | 503 | return Attribute( |
---|
| 504 | 'pdl-override-supported', |
---|
| 505 | [Value(CharacterStringTags.KEYWORD, val)]) |
---|
[aded2d1] | 506 | |
---|
[b828a96] | 507 | def PrinterUpTime(val): |
---|
[aded2d1] | 508 | """4.4.29 printer-up-time (integer(1:MAX)) |
---|
| 509 | |
---|
| 510 | This REQUIRED Printer attribute indicates the amount of time (in |
---|
| 511 | seconds) that this Printer instance has been up and running. The |
---|
| 512 | value is a monotonically increasing value starting from 1 when the |
---|
| 513 | Printer object is started-up (initialized, booted, etc.). This |
---|
| 514 | value is used to populate the Event Time Job Description Job |
---|
| 515 | attributes 'time-at-creation', 'time-at-processing', and |
---|
| 516 | 'time-at-completed' (see section 4.3.14). |
---|
| 517 | |
---|
| 518 | If the Printer object goes down at some value 'n', and comes back |
---|
| 519 | up, the implementation MAY: |
---|
| 520 | |
---|
| 521 | 1. Know how long it has been down, and resume at some value |
---|
| 522 | greater than 'n', or |
---|
| 523 | |
---|
| 524 | 2. Restart from 1. |
---|
| 525 | |
---|
| 526 | In other words, if the device or devices that the Printer object |
---|
| 527 | is representing are restarted or power cycled, the Printer object |
---|
| 528 | MAY continue counting this value or MAY reset this value to 1 |
---|
| 529 | depending on implementation. However, if the Printer object |
---|
| 530 | software ceases running, and restarts without knowing the last |
---|
| 531 | value for 'printer- up-time', the implementation MUST reset this |
---|
| 532 | value to 1. If this value is reset and the Printer has persistent |
---|
| 533 | jobs, the Printer MUST reset the 'time-at-xxx(integer) Event Time |
---|
| 534 | Job Description attributes according to Section 4.3.14. An |
---|
| 535 | implementation MAY use both implementation alternatives, depending |
---|
| 536 | on warm versus cold start, respectively. |
---|
| 537 | |
---|
| 538 | """ |
---|
| 539 | |
---|
[b828a96] | 540 | return Attribute( |
---|
| 541 | 'printer-up-time', |
---|
| 542 | [Value(IntegerTags.INTEGER, val)]) |
---|
[aded2d1] | 543 | |
---|
[b828a96] | 544 | def PrinterCurrentTime(val): |
---|
[aded2d1] | 545 | """4.4.30 printer-current-time (dateTime) |
---|
| 546 | |
---|
| 547 | """ |
---|
| 548 | |
---|
[b828a96] | 549 | raise ClientErrorAttributes, "printer-current-time" |
---|
[aded2d1] | 550 | |
---|
[b828a96] | 551 | def MultipleOperationTimeOut(val): |
---|
[aded2d1] | 552 | """4.4.31 multiple-operation-time-out (integer(1:MAX)) |
---|
| 553 | |
---|
| 554 | This Printer attributes identifies the minimum time (in seconds) |
---|
| 555 | that the Printer object waits for additional Send-Document or |
---|
| 556 | Send-URI operations to follow a still-open Job object before |
---|
| 557 | taking any recovery actions, such as the ones indicated in section |
---|
| 558 | 3.3.1. If the Printer object supports the Create-Job and |
---|
| 559 | Send-Document operations (see section 3.2.4 and 3.3.1), it MUST |
---|
| 560 | support this attribute. |
---|
| 561 | |
---|
| 562 | It is RECOMMENDED that vendors supply a value for this attribute |
---|
| 563 | that is between 60 and 240 seconds. An implementation MAY allow a |
---|
| 564 | system administrator to set this attribute (by means outside this |
---|
| 565 | IPP/1.1 document). If so, the system administrator MAY be able to |
---|
| 566 | set values outside this range. |
---|
| 567 | |
---|
| 568 | """ |
---|
| 569 | |
---|
[b828a96] | 570 | return Attribute( |
---|
| 571 | 'multiple-operation-time-out', |
---|
| 572 | [Value(IntegerTags.INTEGER, val)]) |
---|
[aded2d1] | 573 | |
---|
[b828a96] | 574 | def CompressionSupported(*vals): |
---|
[aded2d1] | 575 | """4.4.32 compression-supported (1setOf type3 keyword) |
---|
| 576 | |
---|
| 577 | This REQUIRED Printer attribute identifies the set of supported |
---|
| 578 | compression algorithms for document data. Compression only applies |
---|
| 579 | to the document data; compression does not apply to the encoding |
---|
| 580 | of the IPP operation itself. The supported values are used to |
---|
| 581 | validate the client supplied 'compression' operation attributes in |
---|
| 582 | Print-Job, Send-Document, and Send-URI requests. |
---|
| 583 | |
---|
| 584 | Standard keyword values are : |
---|
| 585 | 'none': no compression is used. |
---|
| 586 | 'deflate': ZIP public domain inflate/deflate) compression |
---|
| 587 | technology in RFC 1951 [RFC1951] |
---|
| 588 | 'gzip' GNU zip compression technology described in RFC 1952 |
---|
| 589 | [RFC1952]. |
---|
| 590 | 'compress': UNIX compression technology in RFC 1977 [RFC1977] |
---|
| 591 | |
---|
| 592 | """ |
---|
| 593 | |
---|
[b828a96] | 594 | return Attribute( |
---|
| 595 | 'compression-supported', |
---|
| 596 | [Value(CharacterStringTags.KEYWORD, val) for val in vals]) |
---|
[aded2d1] | 597 | |
---|
[b828a96] | 598 | def JobKOctetsSupported(val): |
---|
[aded2d1] | 599 | """4.4.33 job-k-octets-supported (rangeOfInteger(0:MAX)) |
---|
| 600 | |
---|
| 601 | """ |
---|
| 602 | |
---|
[b828a96] | 603 | raise ClientErrorAttributes, "job-k-octets-supported" |
---|
[aded2d1] | 604 | |
---|
[b828a96] | 605 | def JobImpressionsSupported(val): |
---|
[aded2d1] | 606 | """4.4.34 job-impressions-supported (rangeOfInteger(0:MAX)) |
---|
| 607 | |
---|
| 608 | """ |
---|
| 609 | |
---|
[b828a96] | 610 | raise ClientErrorAttributes, "job-impressions-supported" |
---|
[aded2d1] | 611 | |
---|
[b828a96] | 612 | def JobMediaSheetsSupported(val): |
---|
[aded2d1] | 613 | """4.4.35 job-media-sheets-supported (rangeOfInteger(0:MAX)) |
---|
| 614 | |
---|
| 615 | """ |
---|
| 616 | |
---|
[b828a96] | 617 | raise ClientErrorAttributes, "job-media-sheets-supported" |
---|
[aded2d1] | 618 | |
---|
[b828a96] | 619 | def PagesPerMinute(val): |
---|
[aded2d1] | 620 | """4.4.36 pages-per-minute (integer(0:MAX)) |
---|
| 621 | |
---|
| 622 | """ |
---|
| 623 | |
---|
[b828a96] | 624 | raise ClientErrorAttributes, "pages-per-minute" |
---|
[aded2d1] | 625 | |
---|
[b828a96] | 626 | def PagesPerMinuteColor(val): |
---|
[aded2d1] | 627 | """4.4.37 pages-per-minute-color (integer(0:MAX)) |
---|
| 628 | |
---|
| 629 | """ |
---|
| 630 | |
---|
[b828a96] | 631 | raise ClientErrorAttributes, "pages-per-minute-color" |
---|
[aded2d1] | 632 | |
---|