[SCM] morituri/master: * morituri/rip/debug.py: Add checksum task for debugging.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:09:33 UTC 2014


The following commit has been merged in the master branch:
commit 3093d50986dbc6ba79d65c861c714cfb12288ef9
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sat Aug 6 12:26:04 2011 +0000

    	* morituri/rip/debug.py:
    	  Add checksum task for debugging.

diff --git a/ChangeLog b/ChangeLog
index fcc9e3b..904d674 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-06  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* morituri/rip/debug.py:
+	  Add checksum task for debugging.
+
 2011-08-05  Thomas Vander Stichele  <thomas at apestaart dot org>
 
 	* morituri/common/checksum.py:
diff --git a/morituri/rip/debug.py b/morituri/rip/debug.py
index 812e2fb..116c089 100644
--- a/morituri/rip/debug.py
+++ b/morituri/rip/debug.py
@@ -24,6 +24,32 @@ from morituri.common import logcommand
 
 from morituri.extern.task import task, gstreamer
 
+class Checksum(logcommand.LogCommand):
+
+    summary = "run a checksum task"
+
+    def addOptions(self):
+        # here to avoid import gst eating our options
+        from morituri.common import checksum
+
+    def do(self, args):
+        try:
+            fromPath = unicode(args[0])
+        except IndexError:
+            self.stdout.write('Please specify an input file.\n')
+            return 3
+
+        runner = task.SyncRunner()
+
+        from morituri.common import checksum
+        checksumtask = checksum.CRC32Task(fromPath)
+
+        runner.run(checksumtask)
+
+        self.stdout.write('Checksum: %08x\n' % checksumtask.checksum)
+
+
+
 class Encode(logcommand.LogCommand):
 
     summary = "run an encode task"
@@ -59,10 +85,9 @@ class Encode(logcommand.LogCommand):
 
         runner.run(encodetask)
 
-
 class Debug(logcommand.LogCommand):
     summary = "debug internals"
 
-    subCommandClasses = [Encode, ]
+    subCommandClasses = [Checksum, Encode, ]
 
 

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list