Changeset 2671
- Timestamp:
- 02/11/06 22:25:37 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkbcodes
r2658 r2671 90 90 91 91 if options["delete"] : 92 self.display("%s...\n" % _(" Processing"))92 self.display("%s...\n" % _("Deletion")) 93 93 todelete = self.storage.getMatchingBillingCodes(",".join(names)) 94 94 nbtotal = len(todelete) … … 97 97 percent = 100.0 * float(i) / float(nbtotal) 98 98 self.display("\r%.02f%%" % percent) 99 self.display("\r100.00%%\r ")100 self.display("\r%s\n" % _("Done."))101 99 else : 102 if (options["list"] or options["reset"]) and not names :103 names = ["*"]104 105 100 if options["add"] : 101 self.display("%s...\n" % _("Creation")) 106 102 billingcodes = [] 107 for bname in names : 103 nbtotal = len(names) 104 for i in range(nbtotal) : 105 bname = names[i] 108 106 billingcode = self.storage.getBillingCode(bname) 109 107 if billingcode.Exists : … … 119 117 else : 120 118 billingcodes.append(billingcode) 119 percent = 100.0 * float(i) / float(nbtotal) 120 self.display("\r%.02f%%" % percent) 121 self.display("\r100.00%%\r \r%s\n" % _("Done.")) 121 122 else : 123 if not names : 124 names = ["*"] 122 125 billingcodes = self.storage.getMatchingBillingCodes(",".join(names)) 123 126 if not billingcodes : 124 127 raise PyKotaCommandLineError, _("There's no billingcode matching %s") % " ".join(names) 125 128 126 for billingcode in billingcodes : 129 nbtotal = len(billingcodes) 130 if not options["list"] : 131 self.display("Modification...\n") 132 for i in range(nbtotal) : 133 billingcode = billingcodes[i] 127 134 if options["list"] : 128 135 print "%s [%s] %s %s %s %.2f %s" % \ … … 138 145 if options["description"] is not None : 139 146 billingcode.setDescription(options["description"].strip()) 147 percent = 100.0 * float(i) / float(nbtotal) 148 self.display("\r%.02f%%" % percent) 149 150 if not options["list"] : 151 self.display("\r100.00%%\r \r%s\n" % _("Done.")) 140 152 141 153 if __name__ == "__main__" :