Changeset 2512 for pykota/trunk/bin/pkbcodes
- Timestamp:
- 09/27/05 20:34:31 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkbcodes
r2344 r2512 29 29 import pwd 30 30 31 from pykota.tool import PyKotaTool, PyKotaToolError, crashed, N_31 from pykota.tool import PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_ 32 32 33 33 __doc__ = N_("""pkbcodes v%(__version__)s (c) %(__years__)s %(__author__)s … … 87 87 """Manage billing codes.""" 88 88 if (not self.config.isAdmin) and (not options["list"]) : 89 raise PyKota ToolError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command."))89 raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command.")) 90 90 91 91 if (options["list"] or options["reset"]) and not names : … … 111 111 billingcodes = self.storage.getMatchingBillingCodes(",".join(names)) 112 112 if not billingcodes : 113 raise PyKota ToolError, _("There's no billingcode matching %s") % " ".join(names)113 raise PyKotaCommandLineError, _("There's no billingcode matching %s") % " ".join(names) 114 114 115 115 for billingcode in billingcodes : … … 160 160 or (options["skipexisting"] and not options["add"]) \ 161 161 or (options["list"] and (options["add"] or options["delete"] or options["reset"] or options["description"])) : 162 raise PyKota ToolError, _("incompatible options, see help.")162 raise PyKotaCommandLineError, _("incompatible options, see help.") 163 163 elif (not args) and (options["add"] or options["delete"]) : 164 raise PyKota ToolError, _("You have to pass billing codes on the command line")164 raise PyKotaCommandLineError, _("You have to pass billing codes on the command line") 165 165 else : 166 166 retcode = manager.main(args, options) 167 167 except KeyboardInterrupt : 168 168 sys.stderr.write("\nInterrupted with Ctrl+C !\n") 169 except PyKotaCommandLineError, msg : 170 sys.stderr.write("%s : %s\n" % (sys.argv[0], msg)) 169 171 except SystemExit : 170 172 pass