Changeset 3088 for pykota/trunk/bin

Show
Ignore:
Timestamp:
11/30/06 22:24:37 (18 years ago)
Author:
jerome
Message:

Minor improvements.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pkrefund

    r3087 r3088  
    187187        self.ypos -= (size + 4) 
    188188         
    189     def pagePDF(self, receiptnumber, name, values, unitname, reason) : 
     189    def pagePDF(self, receiptnumber, name, values, unit, reason) : 
    190190        """Generates a new page in the PDF document.""" 
    191191        if values["nbpages"] : 
     
    200200            self.printVar(_("Jobs refunded"), str(values["nbjobs"]), 22) 
    201201            self.printVar(_("Pages refunded"), str(values["nbpages"]), 22) 
    202             self.printVar(_("Amount refunded"), "%.3f %s" % (values["nbcredits"], unitname), 22) 
     202            self.printVar(_("Amount refunded"), "%.3f %s" % (values["nbcredits"], unit), 22) 
    203203            self.ypos -= 20 
    204204            self.printVar(_("Reason"), reason, 14) 
     
    217217        c.setTitle("PyKota print job refunding receipts") 
    218218        c.setSubject("Print job refunding receipts generated with PyKota") 
    219          
    220219         
    221220        self.canvas.beginForm("background") 
     
    261260            sys.stdout.flush() 
    262261         
    263     def genReceipts(self, peruser, logo, outfname, firstnumber, reason) : 
     262    def genReceipts(self, peruser, logo, outfname, firstnumber, reason, unit) : 
    264263        """Generates the receipts file.""" 
    265264        if outfname and len(peruser) : 
    266             percent = Percent(self) 
    267             percent.setSize(len(peruser)) 
     265            percent = Percent(self, size=len(peruser)) 
    268266            if outfname != "-" : 
    269267                percent.display("%s...\n" % _("Generating receipts")) 
     
    272270            number = firstnumber 
    273271            for (name, values) in peruser.items() : 
    274                 number += self.pagePDF(number, name, values, options["unit"], reason) 
     272                number += self.pagePDF(number, name, values, unit, reason) 
    275273                if outfname != "-" : 
    276274                    percent.oneMore() 
     
    391389                            break 
    392390                    print         
    393         self.genReceipts(peruser, options["logo"].strip(), options["output"], firstnumber, reason) 
     391        self.genReceipts(peruser, options["logo"].strip(), options["output"], firstnumber, reason, options["unit"]) 
    394392        if options["output"] != "-" :     
    395393            print _("Refunded %i users for %i jobs, %i pages and %.3f credits") % (len(peruser), nbjobs, nbpages, nbcredits)