Ignore:
Timestamp:
Jan 21, 2012, 7:57:40 PM (12 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
no-cups
Children:
7e29e6a
Parents:
33528b4
git-author:
Jessica B. Hamrick <jhamrick@…> (01/21/12 19:57:40)
git-committer:
Jessica B. Hamrick <jhamrick@…> (01/21/12 19:57:40)
Message:

Make threading in printer.py more robust

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach/server/errors.py

    r951ab1b r5e70cc2  
    1313
    1414class InvalidPrinterStateException(Exception):
     15    errstr = {
     16        3: "idle",
     17        4: "processing",
     18        5: "stopped"
     19        }
     20   
    1521    def __init__(self, state):
    16         self.state = hex(state)
     22        self.state = int(state)
    1723    def __str__(self):
    18         return "Invalid printer state: %s" % self.state
     24        return "Invalid printer state: %s (%s)" % \
     25               (self.errstr[self.state], hex(self.state))
    1926
    2027class InvalidJobStateException(Exception):
Note: See TracChangeset for help on using the changeset viewer.