source: server/lib/gutenbach/ipp/core/constants.py @ 609a9b0

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

Add basic configuration file support

  • Property mode set to 100644
File size: 8.8 KB
Line 
1__all__ = [
2    'JobStates',
3    'PrinterStates',
4    'OperationCodes',
5    'SuccessCodes',
6    'ClientErrorCodes',
7    'ServerErrorCodes',
8    'ErrorCodes',
9    'StatusCodes',
10    'CUPSPrinterType',
11    'AttributeTags',
12    'OutOfBandTags',
13    'IntegerTags',
14    'OctetStringTags',
15    'CharacterStringTags',
16]
17
18class JobStates():
19    """Job state codes, as defined by RFC 2911, Section 4.3.7
20   
21    """
22
23    PENDING    = 3
24    HELD       = 4
25    PROCESSING = 5
26    STOPPED    = 6
27    CANCELLED  = 7
28    ABORTED    = 8
29    COMPLETE   = 9
30
31    def __init__(self): pass
32
33class PrinterStates():
34    """Printer state codes, as defined by RFC 2911, Section 4.4.11
35   
36    """
37
38    IDLE       = 3
39    PROCESSING = 4
40    STOPPED    = 5
41
42    def __init__(self): pass
43
44class OperationCodes():
45    """IPP and CUPS IPP Operations, as defined in various RFCs:
46
47        0x0002 - 0x0012      RFC 2911 (Section 4.4.15)
48        0x0013 - 0x0015      RFC 3380 (Section 4)
49        0x0016 - 0x001b      RFC 3995 (Section 7.1)
50        0x0022 - 0x0031      RFC 3998 (Section 14.3)
51        0x4000 - 0x4027      CUPS IPP Actions
52       
53    """
54
55    # These are defined in RFC 2911, Section 4.4.15
56    PRINT_JOB              = 0x0002
57    PRINT_URI              = 0x0003
58    VALIDATE_JOB           = 0x0004
59    CREATE_JOB             = 0x0005
60    SEND_DOCUMENT          = 0x0006
61    SEND_URI               = 0x0007
62    CANCEL_JOB             = 0x0008
63    GET_JOB_ATTRIBUTES     = 0x0009
64    GET_JOBS               = 0x000a
65    GET_PRINTER_ATTRIBUTES = 0x000b
66    #HOLD_JOB              = 0x000c
67    #RELEASE_JOB           = 0x000d
68    RESTART_JOB            = 0x000e
69    PAUSE_PRINTER          = 0x0010
70    RESUME_PRINTER         = 0x0011
71    #PURGE_JOBS            = 0x0012
72
73    # These are defined in RFC 3380, Section 4
74    SET_PRINTER_ATTRIBUTES           = 0x0013
75    SET_JOB_ATTRIBUTES               = 0x0014
76    #GET_PRINTER_SUPPORTED_VALUES    = 0x0015
77
78    # These are defined in RFC 3995, Section 7.1
79    #CREATE_PRINTER_SUBSCRIPTION     = 0x0016
80    #CREATE_JOB_SUBSCRIPTION         = 0x0017
81    #GET_SUBSCRIPTION_ATTRIBUTES     = 0x0018
82    #GET_SUBSCRIPTIONS               = 0x0019
83    #RENEW_SUBSCRIPTION              = 0x001a
84    #CANCEL_SUBSCRIPTION             = 0x001b
85
86    # These are defined in RFC 3998, Section 14.3
87    #ENABLE_PRINTER                  = 0x0022
88    #DISABLE_PRINTER                 = 0x0023
89    #PAUSE_PRINTER_AFTER_CURRENT_JOB = 0x0024
90    #HOLD_NEW_JOBS                   = 0x0025
91    #RELEASE_HELD_NEW_JOBS           = 0x0026
92    #DEACTIVATE_PRINTER              = 0x0027
93    #ACTIVATE_PRINTER                = 0x0028
94    #RESTART_PRINTER                 = 0x0029
95    #SHUTDOWN_PRINTER                = 0x002a
96    #STARTUP_PRINTER                 = 0x002b
97    #REPROCESS_JOB                   = 0x002c
98    #CANCEL_CURRENT_JOB              = 0x002d
99    #SUSPEND_CURRENT_JOB             = 0x002e
100    #RESUME_JOB                      = 0x002f
101    PROMOTE_JOB                      = 0x0030
102    #SCHEDULE_JOB_AFTER              = 0x0031
103
104    # These are special CUPS actions, defined in:
105    # http://www.cups.org/documentation.php/spec-ipp.html
106    #PRIVATE               = 0x4000
107    CUPS_GET_DEFAULT       = 0x4001
108    CUPS_GET_PRINTERS      = 0x4002
109    #CUPS_ADD_PRINTER      = 0x4003
110    #CUPS_DELETE_PRINTER   = 0x4004
111    CUPS_GET_CLASSES       = 0x4005
112    #CUPS_ADD_CLASS        = 0x4006
113    #CUPS_DELETE_CLASS     = 0x4007
114    #CUPS_ACCEPT_JOBS      = 0x4008
115    #CUPS_REJECT_JOBS      = 0x4009
116    #CUPS_SET_DEFAULT      = 0x400a
117    #CUPS_GET_DEVICES      = 0x400b
118    #CUPS_GET_PPDS         = 0x400c
119    #CUPS_MOVE_JOB         = 0x400d
120    #CUPS_AUTHENTICATE_JOB = 0x400e
121    #CUPS_GET_PPD          = 0x400f
122    CUPS_GET_DOCUMENT      = 0x4027
123
124    def __init__(self): pass
125
126class SuccessCodes():
127    """Success status codes as defined in RFC 2911, Section 13
128   
129    """
130   
131    OK                           = 0x0000
132    OK_SUBST                     = 0x0001
133    OK_CONFLICT                  = 0x0002
134    OK_IGNORED_SUBSCRIPTIONS     = 0x0003
135    OK_IGNORED_NOTIFICATIONS     = 0x0004
136    OK_TOO_MANY_EVENTS           = 0x0005
137    OK_BUT_CANCEL_SUBSCRIPTION   = 0x0006
138
139    def __init__(self): pass
140
141class ClientErrorCodes():
142    """Client error codes as defined in RFC 2911, Section 13
143   
144    """
145   
146    BAD_REQUEST                  = 0x0400
147    FORBIDDEN                    = 0x0401
148    NOT_AUTHENTICATED            = 0x0402
149    NOT_AUTHORIZED               = 0x0403
150    NOT_POSSIBLE                 = 0x0404
151    TIMEOUT                      = 0x0405
152    NOT_FOUND                    = 0x0406
153    GONE                         = 0x0407
154    REQUEST_ENTITY               = 0x0408
155    REQUEST_VALUE                = 0x0409
156    DOCUMENT_FORMAT              = 0x040a
157    ATTRIBUTES                   = 0x040b
158    URI_SCHEME                   = 0x040c
159    CHARSET                      = 0x040d
160    CONFLICT                     = 0x040e
161    COMPRESSION_NOT_SUPPORTED    = 0x040f
162    COMPRESSION_ERROR            = 0x0410
163    DOCUMENT_FORMAT_ERROR        = 0x0411
164    DOCUMENT_ACCESS_ERROR        = 0x0412
165    ATTRIBUTES_NOT_SETTABLE      = 0x0413
166    IGNORED_ALL_SUBSCRIPTIONS    = 0x0414
167    TOO_MANY_SUBSCRIPTIONS       = 0x0415
168    IGNORED_ALL_NOTIFICATIONS    = 0x0416
169    PRINT_SUPPORT_FILE_NOT_FOUND = 0x0417
170
171    def __init__(self): pass
172
173class ServerErrorCodes():
174    """Server error codes as defined in RFC 2911, Section 13
175   
176    """
177
178    INTERNAL_ERROR              = 0x0500
179    OPERATION_NOT_SUPPORTED     = 0x0501
180    SERVICE_UNAVAILABLE         = 0x0502
181    VERSION_NOT_SUPPORTED       = 0x0503
182    DEVICE_ERROR                = 0x0504
183    TEMPORARY_ERROR             = 0x0505
184    NOT_ACCEPTING               = 0x0506
185    PRINTER_BUSY                = 0x0507
186    ERROR_JOB_CANCELLED         = 0x0508
187    MULTIPLE_JOBS_NOT_SUPPORTED = 0x0509
188    PRINTER_IS_DEACTIVATED      = 0x050a
189
190    def __init__(self): pass
191
192class StatusCodes(SuccessCodes, ClientErrorCodes, ServerErrorCodes):
193    pass
194class ErrorCodes(ClientErrorCodes, ServerErrorCodes):
195    pass
196
197class CUPSPrinterType():
198    """Printer types as defined by cups_ptype_e in the CUPS API
199    specification:
200   
201    http://www.cups.org/documentation.php/doc-1.3/api-cups.html#cups_ptype_e
202   
203    """
204
205    LOCAL         = 0x000000
206    CLASS         = 0x000001
207    REMOTE        = 0x000002
208    BW            = 0x000004
209    COLOR         = 0x000008
210
211    DUPLEX        = 0x000010
212    STAPLE        = 0x000020
213    COPIES        = 0x000040
214    COLLATE       = 0x000080
215
216    PUNCH         = 0x000100
217    COVER         = 0x000200
218    BIND          = 0x000400
219    SORT          = 0x000800
220
221    SMALL         = 0x001000
222    MEDIUM        = 0x002000
223    LARGE         = 0x004000
224    VARIABLE      = 0x008000
225
226    IMPLICIT      = 0x010000
227    DEFAULT       = 0x020000
228    FAX           = 0x040000
229    REJECTING     = 0x080000
230
231    DELETE        = 0x100000
232    NOT_SHARED    = 0x200000
233    AUTHENTICATED = 0x400000
234    COMMANDS      = 0x800000
235
236    OPTIONS       = 0x00e6ff
237
238    def __init__(self): pass
239
240class AttributeTags():
241    """Contains constants for the attribute IPP tags, as defined by
242    RFC 2565.
243   
244    """
245   
246    ZERO_NAME_LENGTH   = 0x00
247    OPERATION          = 0x01
248    JOB                = 0x02
249    END                = 0x03
250    PRINTER            = 0x04
251    UNSUPPORTED        = 0x05
252    SUBSCRIPTION       = 0x06
253    EVENT_NOTIFICATION = 0x07
254
255    def __init__(self): pass
256
257class OutOfBandTags():
258    """Contains constants for the out-of-band value IPP tags, as
259    defined by RFC 2565.
260   
261    """
262   
263    UNSUPPORTED      = 0x10
264    DEFAULT          = 0x11
265    UNKNOWN          = 0x12
266    NO_VALUE         = 0x13
267    NOT_SETTABLE     = 0x15
268    DELETE_ATTRIBUTE = 0x16
269    ADMIN_DEFINE     = 0x17
270
271    def __init__(self): pass
272
273class IntegerTags():
274    """Contains constants for the integer value IPP tags, as defined
275    by RFC 2565.
276   
277    """
278   
279    GENERIC = 0x20
280    INTEGER = 0x21
281    BOOLEAN = 0x22
282    ENUM    = 0x23
283
284    def __init__(self): pass
285
286class OctetStringTags():
287    """Contains constants for the octetString value IPP tags, as
288    defined by RFC 2565.
289   
290    """
291   
292    UNSPECIFIED_OCTETSTRING = 0x30
293    DATETIME                = 0x31
294    RESOLUTION              = 0x32
295    RANGE_OF_INTEGER        = 0x33
296    BEG_COLLECTION          = 0x34
297    TEXT_WITH_LANGUAGE      = 0x35
298    NAME_WITH_LANGUAGE      = 0x36
299    END_COLLECTION          = 0x37
300
301    def __init__(self): pass
302
303class CharacterStringTags():
304    """Contains constants for the character-string value IPP tags, as
305    defined by RFC 2565.
306   
307    """
308   
309    GENERIC               = 0x40
310    TEXT_WITHOUT_LANGUAGE = 0x41
311    NAME_WITHOUT_LANGUAGE = 0x42
312    KEYWORD               = 0x44
313    URI                   = 0x45
314    URI_SCHEME            = 0x46
315    CHARSET               = 0x47
316    NATURAL_LANGUAGE      = 0x48
317    MIME_MEDIA_TYPE       = 0x49                                   
318    MEMBER_ATTR_NAME      = 0x4a
Note: See TracBrowser for help on using the repository browser.