jhbuild r2149 - in trunk: . jhbuild/commands



Author: fpeters
Date: Mon Jun 23 21:04:47 2008
New Revision: 2149
URL: http://svn.gnome.org/viewvc/jhbuild?rev=2149&view=rev

Log:
* jhbuild/commands/rdepends.py: catch KeyError on invalid module and
display a nice error message.



Modified:
   trunk/ChangeLog
   trunk/jhbuild/commands/rdepends.py

Modified: trunk/jhbuild/commands/rdepends.py
==============================================================================
--- trunk/jhbuild/commands/rdepends.py	(original)
+++ trunk/jhbuild/commands/rdepends.py	Mon Jun 23 21:04:47 2008
@@ -21,6 +21,7 @@
 
 import jhbuild.moduleset
 from jhbuild.commands import Command, register_command
+from jhbuild.errors import UsageError, FatalError, CommandError
 
 
 class cmd_rdepends(Command):
@@ -45,7 +46,10 @@
         if not args:
             self.parser.error(_('This command requires a module parameter.'))
 
-        modname = module_set.get_module(args[0], ignore_case = True).name
+        try:
+            modname = module_set.get_module(args[0], ignore_case = True).name
+        except KeyError:
+            raise FatalError(_("A module called '%s' could not be found.") % args[0])
 
         # get all modules but those that are a dependency of modname
         dependencies_list = [x.name for x in module_set.get_module_list([modname])]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]