[SCM] morituri/master: * morituri/common/drive.py: * morituri/rip/drive.py: Extract getDeviceInfo function.

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


The following commit has been merged in the master branch:
commit 18c99b6e776456074506306e707826e60374ab3a
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sun Dec 2 12:04:45 2012 +0000

    	* morituri/common/drive.py:
    	* morituri/rip/drive.py:
    	  Extract getDeviceInfo function.

diff --git a/ChangeLog b/ChangeLog
index e3dd695..ce6bc6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-12-02  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+	* morituri/common/drive.py:
+	* morituri/rip/drive.py:
+	  Extract getDeviceInfo function.
+
+2012-12-02  Thomas Vander Stichele  <thomas at apestaart dot org>
+
 	* morituri/common/config.py (added):
 	* morituri/test/test_common_config.py (added):
 	* morituri/common/Makefile.am:
diff --git a/morituri/common/drive.py b/morituri/common/drive.py
index 95c9452..8037efb 100644
--- a/morituri/common/drive.py
+++ b/morituri/common/drive.py
@@ -58,3 +58,15 @@ def _getAllDevicePathsStatic():
             ret.append(c)
 
     return ret
+
+def getDeviceInfo(path):
+    try:
+        import cdio
+    except ImportError:
+        return None
+
+    device = cdio.Device(path)
+    ok, vendor, model, release = device.get_hwinfo()
+
+    return (vendor, model, release)
+
diff --git a/morituri/rip/drive.py b/morituri/rip/drive.py
index cae3873..b5f2b6c 100644
--- a/morituri/rip/drive.py
+++ b/morituri/rip/drive.py
@@ -40,12 +40,12 @@ class List(logcommand.LogCommand):
         try:
             import cdio
         except ImportError:
-            print 'Install pycdio for vendor/model/release detection.'
+            self.stdout.write(
+                'Install pycdio for vendor/model/release detection.\n')
             return
 
         for path in paths:
-            device = cdio.Device(path)
-            ok, vendor, model, release = device.get_hwinfo()
+            vendor, model, release = drive.getDeviceInfo(path)
             print "drive: %s, vendor: %s, model: %s, release: %s" % (
                 path, vendor, model, release)
 

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list