source: server/lib/gutenbach/ipp/attributes/operation.py @ b01b6d1

no-cups
Last change on this file since b01b6d1 was b01b6d1, checked in by Jessica B. Hamrick <jhamrick@…>, 12 years ago

Clean up printer, job, and requests code

  • Property mode set to 100644
File size: 1.8 KB
Line 
1__all__ = [
2    'PrinterUri',
3    'RequestingUserName',
4    'IppAttributeFidelity',
5    'LastDocument',
6    'Limit',
7    'RequestedAttributes',
8    'WhichJobs',
9    'MyJobs',
10    'DocumentName',
11    'Compression',
12    'DocumentFormat',
13    'DocumentNaturalLanguage',
14]
15
16from .. import Attribute
17from .. import Value
18from .. import errors
19from .. import CharacterStringTags, IntegerTags
20
21def PrinterUri(val):
22    return Attribute(
23        'printer-uri',
24        [Value(CharacterStringTags.URI, val)])
25
26def RequestingUserName(val):
27    return Attribute(
28        'requesting-user-name',
29        [Value(CharacterStringTags.NAME_WITHOUT_LANGUAGE, val)])
30
31def IppAttributeFidelity(val):
32    raise errors.ClientErrorAttributes, 'ipp-attribute-fidelity'
33
34def LastDocument(val):
35    return Attribute(
36        'last-document',
37        [Value(IntegerTags.BOOLEAN, val)])
38
39def Limit(val):
40    return Attribute(
41        'limit',
42        [Value(IntegerTags.INTEGER, val)])
43
44def RequestedAttributes(*vals):
45    return Attribute(
46        'requested-attributes',
47        [Value(CharacterStringTags.KEYWORD, val) for val in vals])
48
49def WhichJobs(val):
50    return Attribute(
51        'which-jobs',
52        [Value(CharacterStringTags.KEYWORD, val)])
53
54def MyJobs(val):
55    return Attribute(
56        'my-jobs',
57        [Value(IntegerTags.BOOLEAN, val)])
58
59def DocumentName(val):
60    return Attribute(
61        'document-name',
62        [Value(CharacterStringTags.NAME_WITHOUT_LANGUAGE, val)])
63
64def Compression(val):
65    return Attribute(
66        'compression',
67        [Value(CharacterStringTags.KEYWORD, val)])
68
69def DocumentFormat(val):
70    return Attribute(
71        'document-format',
72        [Value(CharacterStringTags.MIME_MEDIA_TYPE, val)])
73
74def DocumentNaturalLanguage(val):
75    return Attribute(
76        'document-natural-language',
77        [Value(CharacterStringTags.NATURAL_LANGUAGE, val)])
Note: See TracBrowser for help on using the repository browser.