[SCM] morituri/master: error out nicely when debug resultcache cue has no arg

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:10:17 UTC 2014


The following commit has been merged in the master branch:
commit 1ed2f64f2a9617270decd29c35c45ed47bc6fffd
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Tue Jul 15 22:54:49 2014 -0400

    error out nicely when debug resultcache cue has no arg

diff --git a/morituri/rip/debug.py b/morituri/rip/debug.py
index 68a57cc..f6d2894 100644
--- a/morituri/rip/debug.py
+++ b/morituri/rip/debug.py
@@ -33,11 +33,18 @@ class RCCue(logcommand.LogCommand):
     def do(self, args):
         self._cache = cache.ResultCache()
 
-        persisted = self._cache.getRipResult(args[0], create=False)
+        try:
+            discid = args[0]
+        except IndexError:
+            self.stderr.write(
+                'Please specify a cddb disc id\n')
+            return 3
+
+        persisted = self._cache.getRipResult(discid, create=False)
 
         if not persisted:
             self.stderr.write(
-                'Could not find a result for cddb disc id %s\n' % args[0])
+                'Could not find a result for cddb disc id %s\n' % discid)
             return 3
 
         self.stdout.write(persisted.object.table.cue().encode('utf-8'))

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list