Changeset 3095 for pykota/trunk/bin/pkrefund
- Timestamp:
- 11/30/06 23:41:00 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkrefund
r3089 r3095 293 293 raise PyKotaCommandLineError, _("Refunding for no reason is forbidden. Please use the --reason command line option.") 294 294 295 if options["output"] : 296 options["output"] = options["output"].strip() 297 if options["output"] == "-" : 295 outfname = options["output"] 296 if outfname : 297 outfname = outfname.strip() 298 if outfname == "-" : 298 299 options["force"] = True 299 300 self.printInfo(_("The PDF file containing the receipts will be sent to stdout. --force is assumed."), "warn") … … 323 324 else : 324 325 extractonly.update({ filterkey : filtervalue }) 326 327 percent = Percent(self) 328 if outfname != "-" : 329 percent.display("%s..." % _("Extracting datas")) 325 330 326 331 username = extractonly.get("username") … … 353 358 nbcredits = 0.0 354 359 reason = (options.get("reason") or "").strip() 360 percent.setSize(len(jobs)) 361 if outfname != "-" : 362 percent.display("\n") 355 363 for job in jobs : 356 364 if job.JobSize and (job.JobAction not in ("DENY", "CANCEL", "REFUND")) : … … 364 372 counters["nbjobs"] += 1 365 373 nbjobs += 1 374 if outfname != "-" : 375 percent.oneMore() 366 376 else : 367 377 print _("Date : %s") % str(job.JobDate)[:19] … … 389 399 break 390 400 print 391 self.genReceipts(peruser, options["logo"].strip(), options["output"], firstnumber, reason, options["unit"]) 392 if options["output"] != "-" : 401 if outfname != "-" : 402 percent.done() 403 self.genReceipts(peruser, options["logo"].strip(), outfname, firstnumber, reason, options["unit"]) 404 if outfname != "-" : 393 405 print _("Refunded %i users for %i jobs, %i pages and %.3f credits") % (len(peruser), nbjobs, nbpages, nbcredits) 394 406