[SCM] morituri/master: * morituri/common/program.py: * morituri/rip/cd.py: Add load and eject device. Do so before and after ripping.
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:09:20 UTC 2014
The following commit has been merged in the master branch:
commit 6581261a76fcfd2d448cfe68fc9a9974967d9cda
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Sat Jan 1 11:24:26 2011 +0000
* morituri/common/program.py:
* morituri/rip/cd.py:
Add load and eject device. Do so before and after ripping.
diff --git a/ChangeLog b/ChangeLog
index a72f988..c3b4298 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-12-30 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * morituri/common/program.py:
+ * morituri/rip/cd.py:
+ Add load and eject device. Do so before and after ripping.
+
2010-11-14 Thomas Vander Stichele <thomas at apestaart dot org>
patch by: Loïc Minier <lool at debian dot org>
diff --git a/morituri/common/program.py b/morituri/common/program.py
index d5e3bdf..ef03add 100644
--- a/morituri/common/program.py
+++ b/morituri/common/program.py
@@ -173,6 +173,18 @@ class Program(log.Loggable):
'result')
return path
+ def loadDevice(self, device):
+ """
+ Load the given device.
+ """
+ os.system('eject -t %s' % device)
+
+ def ejectDevice(self, device):
+ """
+ Eject the given device.
+ """
+ os.system('eject %s' % device)
+
def unmountDevice(self, device):
"""
Unmount the given device if it is mounted, as happens with automounted
diff --git a/morituri/rip/cd.py b/morituri/rip/cd.py
index 5a3e6bb..8b64811 100644
--- a/morituri/rip/cd.py
+++ b/morituri/rip/cd.py
@@ -88,6 +88,7 @@ Discs are named according to the disc template:
default, "', '".join(encode.PROFILES.keys())),
default=default)
+
def handleOptions(self, options):
options.track_template = options.track_template.decode('utf-8')
options.disc_template = options.disc_template.decode('utf-8')
@@ -103,6 +104,7 @@ Discs are named according to the disc template:
device = self.parentCommand.options.device
print 'Checking device', device
+ prog.loadDevice(device)
prog.unmountDevice(device)
# first, read the normal TOC, which is fast
@@ -289,7 +291,7 @@ See http://sourceforge.net/tracker/?func=detail&aid=604751&group_id=2171&atid=1
print 'Album not found in AccurateRip database'
if responses:
- print '%d AccurateRip responses found' % len(responses)
+ print '%d AccurateRip reponses found' % len(responses)
if responses[0].cddbDiscId != itable.getCDDBDiscId():
print "AccurateRip response discid different: %s" % \
@@ -304,6 +306,8 @@ See http://sourceforge.net/tracker/?func=detail&aid=604751&group_id=2171&atid=1
logger = result.getLogger()
prog.writeLog(discName, logger)
+ prog.ejectDevice(device)
+
class CD(logcommand.LogCommand):
summary = "handle CD's"
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list