From 66abdfb21455f4fc7d61eb78bccd108d70314825 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Fri, 10 May 2013 22:06:29 +0200 Subject: [PATCH] Accept more than one file for checksum. --- morituri/rip/debug.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/morituri/rip/debug.py b/morituri/rip/debug.py index d8d27d6..96b14e6 100644 --- a/morituri/rip/debug.py +++ b/morituri/rip/debug.py @@ -100,21 +100,22 @@ class Checksum(logcommand.LogCommand): summary = "run a checksum task" def do(self, args): - try: - fromPath = unicode(args[0]) - except IndexError: - self.stdout.write('Please specify an input file.\n') + if not args: + self.stdout.write('Please specify one or more input files.\n') return 3 runner = task.SyncRunner() - # here to avoid import gst eating our options from morituri.common import checksum - checksumtask = checksum.CRC32Task(fromPath) - runner.run(checksumtask) + for arg in args: + fromPath = unicode(args[0]) - self.stdout.write('Checksum: %08x\n' % checksumtask.checksum) + checksumtask = checksum.CRC32Task(fromPath) + + runner.run(checksumtask) + + self.stdout.write('Checksum: %08x\n' % checksumtask.checksum) class Encode(logcommand.LogCommand):