UsageError -> UserError in a few libbe.command.* submods.
authorW. Trevor King <wking@drexel.edu>
Sat, 26 Jun 2010 13:55:49 +0000 (09:55 -0400)
committerW. Trevor King <wking@drexel.edu>
Sat, 26 Jun 2010 13:55:49 +0000 (09:55 -0400)
This catches them up with the removal of UsageError in
  commit bf3d434b244c57556bec979acbc658c30eb58221
  Author: W. Trevor King <wking@drexel.edu>
  Date:   Sat Dec 12 00:31:55 2009 -0500

    Added libbe.command.base (with Command class) and moved list
    command to new format.
I guess I don't make many mistakes entering those commands ;).

libbe/command/close.py
libbe/command/depend.py
libbe/command/open.py
libbe/command/show.py

index 7cb51b1b14706b5523f042713c66aa7f571ba3f0..f470950cba28ddb84e46923e7263cf973dd4e2d9 100644 (file)
@@ -41,9 +41,9 @@ def execute(args, manipulate_encodings=True):
     cmdutil.default_complete(options, args, parser,
                              bugid_args={0: lambda bug : bug.active==True})
     if len(args) == 0:
-        raise cmdutil.UsageError("Please specify a bug id.")
+        raise cmdutil.UserError("Please specify a bug id.")
     if len(args) > 1:
-        raise cmdutil.UsageError("Too many arguments.")
+        raise cmdutil.UserError("Too many arguments.")
     bd = bugdir.BugDir(from_disk=True,
                        manipulate_encodings=manipulate_encodings)
     bug = cmdutil.bug_from_shortname(bd, args[0])
index e32d55ed333bfd2b5a90ec3c86ca48841306932c..92140eba8c0c8e6e39b04c60c2e370cde042ad9e 100644 (file)
@@ -119,14 +119,14 @@ class Depend (libbe.command.Command):
 
     def _run(self, **params):
         if params['repair'] == True and params['bug-id'] != None:
-            raise libbe.command.UsageError(
+            raise libbe.command.UserError(
                 'No arguments with --repair calls.')
         if params['repair'] == False and params['bug-id'] == None:
-            raise libbe.command.UsageError(
+            raise libbe.command.UserError(
                 'Must specify either --repair or a BUG-ID')
         if params['tree-depth'] != None \
                 and params['blocking-bug-id'] != None:
-            raise libbe.command.UsageError(
+            raise libbe.command.UserError(
                 'Only one bug id used in tree mode.')
         bugdir = self._get_bugdir()
         if params['repair'] == True:
index b4099658c41414cbde134d9be2c3d6e0f7bdf3bc..1551962e9b1c3349fd97837e84680301433c7bcb 100644 (file)
@@ -40,9 +40,9 @@ def execute(args, manipulate_encodings=True):
     cmdutil.default_complete(options, args, parser,
                              bugid_args={0: lambda bug : bug.active==False})
     if len(args) == 0:
-        raise cmdutil.UsageError, "Please specify a bug id."
+        raise cmdutil.UserError, "Please specify a bug id."
     if len(args) > 1:
-        raise cmdutil.UsageError, "Too many arguments."
+        raise cmdutil.UserError, "Too many arguments."
     bd = bugdir.BugDir(from_disk=True,
                        manipulate_encodings=manipulate_encodings)
     bug = cmdutil.bug_from_shortname(bd, args[0])
index b2673814dba67a0c68a775aef027b33f9e538674..c6ad37d3af07d87858b8c997eeec82bd80b7c9e6 100644 (file)
@@ -101,12 +101,12 @@ class Show (libbe.command.Command):
         bugdir = self._get_bugdir()
         if params['only-raw-body'] == True:
             if len(params['id']) != 1:
-                raise libbe.command.UsageError(
+                raise libbe.command.UserError(
                     'only one ID accepted with --only-raw-body')
             bug,comment = libbe.command.util.bug_comment_from_user_id(
                 bugdir, params['id'][0])
             if comment == bug.comment_root:
-                raise libbe.command.UsageError(
+                raise libbe.command.UserError(
                     "--only-raw-body requires a comment ID, not '%s'"
                     % params['id'][0])
             sys.__stdout__.write(comment.body)