Changeset 1820 for pykota/trunk/bin/lprngpykota
- Timestamp:
- 10/13/04 22:51:27 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/lprngpykota
r1713 r1820 24 24 # 25 25 # $Log$ 26 # Revision 1.8 2004/10/13 20:51:27 jalet 27 # Made debugging levels be the same in cupspykota and lprngpykota. 28 # Now outputs more information in informational messages : user, printer, jobid 29 # 26 30 # Revision 1.7 2004/09/13 16:02:44 jalet 27 31 # Added fix for incorrect job's size when hardware accounting fails … … 126 130 # we deny the job in this case (nothing to print anyway) 127 131 if not self.jobSizeBytes : 128 self.print Info(_("Job contains no data. Printing is denied."), "warn")132 self.printMoreInfo(user, printer, _("Job contains no data. Printing is denied."), "warn") 129 133 action = "DENY" 130 134 else : … … 138 142 self.prehook(userpquota) 139 143 140 self. logdebug("Job accounting begins.")144 self.printMoreInfo(user, printer, _("Job accounting begins.")) 141 145 self.accounter.beginJob(printer) 142 146 … … 145 149 self.accounter.endJob(printer) 146 150 jobsize = self.accounter.getJobSize(printer) 147 self. logdebug("Job accounting ends.")151 self.printMoreInfo(user, printer, _("Job accounting ends.")) 148 152 149 153 if action == "DENY" : 150 154 jobsize = 0 151 self. logdebug("Job size forced to 0 because printing was denied.")155 self.printMoreInfo(user, printer, _("Job size forced to 0 because printing is denied.")) 152 156 153 157 if (self.accounter.isSoftware) or (action == "DENY") : 154 158 # update the quota for the current user on this printer 155 self. logdebug("Job size : %i"% jobsize)159 self.printMoreInfo(user, printer, _("Job size : %i") % jobsize) 156 160 self.logdebug("Updating user %s's quota on printer %s" % (user.Name, printer.Name)) 157 161 jobprice = userpquota.increasePagesUsage(jobsize) 158 162 159 163 printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), action, jobsize, jobprice, self.preserveinputfile, self.title, self.copies, self.options, clienthost, self.jobSizeBytes) 160 self. logdebug("Job added to history.")164 self.printMoreInfo(user, printer, _("Job added to history.")) 161 165 162 166 # exports some new environment variables … … 189 193 # in second pass, so all work is already done, 190 194 # now we just have to exit successfully 191 self.print Info(_("Software accounting already done in first pass. Ignoring."))195 self.printMoreInfo(user, printer, _("Software accounting already done in first pass. Ignoring.")) 192 196 elif printer.LastJob.JobAction == "DENY" : 193 197 # Hardware accounting method was used, but job 194 198 # was rejected during first pass, so nothing to do 195 self.print Info(_("Hardware accounting already done in first pass. Ignoring."))199 self.printMoreInfo(user, printer, _("Hardware accounting already done in first pass. Ignoring.")) 196 200 else : 197 201 # here if user and userpquota are both None … … 221 225 jobsize = self.accounter.getJobSize(printer) 222 226 223 self. logdebug("Job size : %i"% jobsize)224 self. logdebug("Updating user %s's quota on printer %s"% (user.Name, printer.Name))227 self.printMoreInfo(user, printer, _("Job size : %i") % jobsize) 228 self.printInfo(_("Updating user %s's quota on printer %s") % (user.Name, printer.Name)) 225 229 jobprice = userpquota.increasePagesUsage(jobsize) 226 230 227 231 self.storage.writeLastJobSize(printer.LastJob, jobsize, jobprice) 228 self. logdebug("Job size and price now set in history.")232 self.printMoreInfo(user, printer, _("Job size and price now set in history.")) 229 233 230 234 # exports some new environment variables