Changeset 822 for pykota/trunk
- Timestamp:
- 02/27/03 23:40:26 (22 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pykota
r772 r822 17 17 # 18 18 # $Log$ 19 # Revision 1.9 2003/02/27 22:40:26 jalet 20 # Correctly handles cases where the printer is off. 21 # 19 22 # Revision 1.8 2003/02/09 12:56:53 jalet 20 23 # Internationalization begins... … … 108 111 109 112 # Get the page counter directly from the printer itself 110 counterbeforejob = kotafilter.requester.getPrinterPageCounter(kotafilter.printerhostname) # TODO use printername instead, make them match from CUPS' config files 111 113 try : 114 counterbeforejob = kotafilter.requester.getPrinterPageCounter(kotafilter.printerhostname) # TODO use printername instead, make them match from CUPS' config files 115 except PyKotaRequesterError, msg : 116 # can't get actual page counter, assume printer is off, but warns in log 117 kotafilter.logger.log_message(msg, "warn") 118 printerIsOff = 1 119 else : 120 printerIsOff = 0 121 112 122 # Get the last page counter and last username from the Quota Storage backend 113 123 pgc = kotafilter.storage.getPrinterPageCounter(kotafilter.printername) … … 117 127 kotafilter.logger.log_message(_("Printer %s not registered in the PyKota system") % kotafilter.printername, "warn") 118 128 else : 129 # get last values from Quota Storage 119 130 (lastpagecounter, lastusername) = (pgc["pagecounter"], pgc["lastusername"]) 120 131 132 # if printer is off then we assume the correct counter value is the last one 133 if printerIsOff : 134 counterbeforejob = lastpagecounter 135 121 136 # Update the last page counter and last username in the Quota Storage backend 122 137 # set them to current user and