Changeset 1629 for pykota/trunk/bin
- Timestamp:
- 07/23/04 13:19:48 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/lprngpykota
r1624 r1629 24 24 # 25 25 # $Log$ 26 # Revision 1.5 2004/07/23 11:19:48 jalet 27 # 1.19beta is out ! 28 # 26 29 # Revision 1.4 2004/07/22 22:41:48 jalet 27 30 # Hardware accounting for LPRng should be OK now. UNTESTED. … … 82 85 """First pass done here.""" 83 86 # first we have to check if previous job was correctly accounted for 84 if (printer.LastJob.JobAction != "DENY") and (printer.LastJob.JobSize is None):87 if printer.LastJob.Exists and not printer.LastJob.JobSize : 85 88 # here we know that previous job wasn't accounted for correctly 86 89 # we are sure (?) that it was hardware accounting which was used … … 139 142 self.logdebug("Job size forced to 0 because printing was denied.") 140 143 141 if self.accounter.isSoftware:144 if (self.accounter.isSoftware) or (action == "DENY") : 142 145 # update the quota for the current user on this printer 143 146 self.logdebug("Job size : %i" % jobsize) … … 159 162 self.posthook(userpquota) 160 163 161 # here software accounting was completed.164 # here accounting was completed, either software, or hardware but over quota 162 165 else : 163 166 printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), action, filename=self.preserveinputfile, title=self.title, copies=self.copies, options=self.options, clienthost=clienthost, jobsizebytes=self.jobSizeBytes) … … 177 180 # in second pass, so all work is already done, 178 181 # now we just have to exit successfully 179 self.printInfo(_("Software accounting already done in first pass. Exiting.")) 180 else : 181 # Now we have to check if accounting was completely finished : 182 # if it is, then a big problem occured because with hardware 183 # accounting, only the second pass can know the job's size. 184 if (printer.LastJob.JobSize is not None) : 185 # this could only occur if configuration was modified 186 # between first and second pass, and accounter changed 187 # from software to hardware during this short (?) time. 188 raise PyKotaToolError, _("Hardware accounting already finished ! This should be impossible, please report this problem ASAP.") 189 182 self.printInfo(_("Software accounting already done in first pass. Ignoring.")) 183 elif printer.LastJob.JobAction == "DENY" : 184 # Hardware accounting method was used, but job 185 # was rejected during first pass, so nothing to do 186 self.printInfo(_("Hardware accounting already done in first pass. Ignoring.")) 187 else : 190 188 # here if user and userpquota are both None 191 189 # then it's a special second pass for a job