Changeset 2512 for pykota/trunk/pykota/dumper.py
- Timestamp:
- 09/27/05 20:34:31 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/dumper.py
r2342 r2512 39 39 40 40 from pykota import version 41 from pykota.tool import PyKotaTool, PyKotaToolError, N_41 from pykota.tool import PyKotaTool, PyKotaToolError, PyKotaCommandLineError, N_ 42 42 43 43 class DumPyKota(PyKotaTool) : … … 72 72 """Print Quota Data Dumper.""" 73 73 if restricted and not self.config.isAdmin : 74 raise PyKota ToolError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command."))74 raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command.")) 75 75 76 76 extractonly = {} … … 82 82 raise ValueError 83 83 except ValueError : 84 raise PyKota ToolError, _("Invalid filter value [%s], see help.") % filterexp84 raise PyKotaCommandLineError, _("Invalid filter value [%s], see help.") % filterexp 85 85 else : 86 86 extractonly.update({ filterkey : filtervalue }) … … 88 88 datatype = options["data"] 89 89 if datatype not in self.validdatatypes.keys() : 90 raise PyKota ToolError, _("Invalid modifier [%s] for --data command line option, see help.") % datatype90 raise PyKotaCommandLineError, _("Invalid modifier [%s] for --data command line option, see help.") % datatype 91 91 92 92 format = options["format"] 93 93 if (format not in self.validformats.keys()) \ 94 94 or ((format == "cups") and ((datatype != "history") or options["sum"])) : 95 raise PyKota ToolError, _("Invalid modifier [%s] for --format command line option, see help.") % format95 raise PyKotaCommandLineError, _("Invalid modifier [%s] for --format command line option, see help.") % format 96 96 97 97 if (format == "xml") and not hasJAXML : … … 99 99 100 100 if options["sum"] and datatype not in ("payments", "history") : 101 raise PyKota ToolError, _("Invalid data type [%s] for --sum command line option, see help.") % datatype101 raise PyKotaCommandLineError, _("Invalid data type [%s] for --sum command line option, see help.") % datatype 102 102 103 103 entries = getattr(self.storage, "extract%s" % datatype.title())(extractonly)