source: server/lib/ippconstants.py @ e97c37d

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

Add blank init methods to classes in ippconstants.py

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