Changeset 2790 for pykota/trunk
- Timestamp:
- 03/06/06 08:50:32 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkinvoice
r2689 r2790 47 47 hasPIL = 1 48 48 49 from pykota.tool import P yKotaToolError, PyKotaCommandLineError, crashed, N_49 from pykota.tool import Percent, PyKotaToolError, PyKotaCommandLineError, crashed, N_ 50 50 from pykota.dumper import DumPyKota 51 from pykota.config import PyKotaConfigError52 from pykota.storage import PyKotaStorageError53 51 54 52 __doc__ = N_("""pkinvoice v%(__version__)s (c) %(__years__)s %(__author__)s … … 282 280 names = [ "*" ] 283 281 282 percent = Percent(self) 284 283 outfname = options["output"] 285 284 if outfname != "-" : 286 self.display("%s...\n" % _("Processing")) 287 285 percent.display("%s..." % _("Extracting datas")) 288 286 entries = self.storage.getMatchingUsers(",".join(names)) 287 percent.setSize(len(entries)) 289 288 if entries : 289 percent.display("\n%s\n" % _("Generating invoices")) 290 290 self.initPDF(options["logo"].strip()) 291 nbtotal = len(entries) 292 for i in range(nbtotal) : 293 entry = entries[i] 291 for entry in entries : 294 292 number += self.pagePDF(number, entry, vat, options["start"], options["end"], options["unit"]) 295 293 if outfname != "-" : 296 percent = 100.0 * float(i) / float(nbtotal) 297 self.display("\r%.02f%%" % percent) 294 percent.oneMore() 298 295 299 296 if number > firstnumber : … … 301 298 302 299 if outfname != "-" : 303 self.display("\r100.00%%\r ") 304 self.display("\r%s\n" % _("Done.")) 300 percent.done() 305 301 306 302 if __name__ == "__main__" :