Changeset 2783 for pykota/trunk/bin/pkbcodes
- Timestamp:
- 03/05/06 09:36:47 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkbcodes
r2782 r2783 97 97 raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command.")) 98 98 99 if not options["list"] : 100 percent = Percent(self) 101 99 102 if not options["add"] : 100 103 if not options["list"] : 101 self.display(_("Extracting datas..."))104 percent.display(_("Extracting datas...")) 102 105 if not names : # NB : can't happen for --delete because it's catched earlier 103 106 names = ["*"] … … 105 108 if not billingcodes : 106 109 raise PyKotaCommandLineError, _("There's no billingcode matching %s") % " ".join(names) 110 if not options["list"] : 111 percent.setSize(len(billingcodes)) 107 112 108 113 if options["list"] : … … 116 121 _("credits")) 117 122 elif options["delete"] : 118 percent = Percent(self, "\n%s..." % _("Deletion"), len(billingcodes))123 percent.display("\n%s..." % _("Deletion")) 119 124 self.storage.deleteManyBillingCodes(billingcodes) 120 125 percent.display("\n") … … 129 134 try : 130 135 if options["add"] : 131 percent = Percent(self, "%s...\n" % _("Creation"), len(names)) 136 percent.display("%s...\n" % _("Creation")) 137 percent.setSize(len(names)) 132 138 for bname in names : 133 139 billingcode = StorageBillingCode(self.storage, bname) … … 143 149 percent.oneMore() 144 150 else : 145 percent = Percent(self, "\n%s...\n" % _("Modification"), len(billingcodes))151 percent.display("\n%s...\n" % _("Modification")) 146 152 for billingcode in billingcodes : 147 153 self.modifyBillingCode(billingcode, reset, description) … … 154 160 self.storage.commitTransaction() 155 161 156 try:162 if not options["list"] : 157 163 percent.done() 158 except NameError :159 pass160 164 161 165 if __name__ == "__main__" :