Changeset 2308 for pykota/trunk/bin/cupspykota
- Timestamp:
- 06/10/05 22:39:13 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/cupspykota
r2303 r2308 239 239 self.logdebug("Precomputed job's size is %s pages, price is %s units" % (self.softwareJobSize, self.softwareJobPrice)) 240 240 241 denyduplicates = self.config.getDenyDuplicates(printer.Name) 241 242 if not self.jobSizeBytes : 242 243 # if no data to pass to real backend, probably a filter … … 245 246 self.printMoreInfo(user, printer, _("Job contains no data. Printing is denied."), "warn") 246 247 action = "DENY" 247 elif self.config.getDenyDuplicates(printer.Name)\248 elif denyduplicates \ 248 249 and printer.LastJob.Exists \ 249 250 and (printer.LastJob.UserName == user.Name) \ 250 251 and (printer.LastJob.JobMD5Sum == self.checksum) : 251 self.printMoreInfo(user, printer, _("Job is a duplicate. Printing is denied."), "warn") 252 action = "DENY" 252 if denyduplicates == 1 : 253 self.printMoreInfo(user, printer, _("Job is a duplicate. Printing is denied."), "warn") 254 action = "DENY" 255 else : 256 self.logdebug("Launching subprocess [%s] to see if dupes should be allowed or not." % denyduplicates) 257 fanswer = os.popen(denyduplicates, "r") 258 action = fanswer.read().strip().upper() 259 fanswer.close() 260 if action == "DENY" : 261 self.printMoreInfo(user, printer, _("Job is a duplicate. Printing is denied by subprocess."), "warn") 262 else : 263 self.printMoreInfo(user, printer, _("Job is a duplicate. Printing is allowed by subprocess."), "warn") 264 action = "ALLOW" # just to be sure, in the case the external command returns something else... 253 265 else : 254 266 # checks the user's quota