no-cups
Last change
on this file since 441604f was
441604f,
checked in by Steven Allen <steven@…>, 12 years ago
|
Convert a few tabs to spaces.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | __all__ = [ |
---|
2 | 'InvalidJobException', |
---|
3 | 'InvalidPrinterStateException', |
---|
4 | 'InvalidJobStateException', |
---|
5 | 'MissingDataException' |
---|
6 | ] |
---|
7 | |
---|
8 | class InvalidJobException(Exception): |
---|
9 | def __init__(self, jobid): |
---|
10 | self.jobid = jobid |
---|
11 | def __str__(self): |
---|
12 | return "Job does not exist: %d" % self.jobid |
---|
13 | |
---|
14 | class InvalidPrinterStateException(Exception): |
---|
15 | errstr = { |
---|
16 | 3: "idle", |
---|
17 | 4: "processing", |
---|
18 | 5: "stopped" |
---|
19 | } |
---|
20 | |
---|
21 | def __init__(self, state): |
---|
22 | self.state = int(state) |
---|
23 | def __str__(self): |
---|
24 | return "Invalid printer state: %s (%s)" % \ |
---|
25 | (self.errstr[self.state], hex(self.state)) |
---|
26 | |
---|
27 | class InvalidJobStateException(Exception): |
---|
28 | errstr = { |
---|
29 | 3: "pending", |
---|
30 | 4: "held", |
---|
31 | 5: "processing", |
---|
32 | 6: "stopped", |
---|
33 | 7: "cancelled", |
---|
34 | 8: "aborted", |
---|
35 | 9: "complete" |
---|
36 | } |
---|
37 | |
---|
38 | def __init__(self, state): |
---|
39 | self.state = int(state) |
---|
40 | def __str__(self): |
---|
41 | return "Invalid job state: %s (%s)" % \ |
---|
42 | (self.errstr[self.state], hex(self.state)) |
---|
43 | |
---|
44 | class InvalidDocument(Exception): |
---|
45 | pass |
---|
46 | class MissingDataException(Exception): |
---|
47 | pass |
---|
Note: See
TracBrowser
for help on using the repository browser.