* morituri/common/program.py:

* morituri/rip/cd.py:
	  Add load and eject device.  Do so before and after ripping.
This commit is contained in:
Thomas Vander Stichele
2011-01-01 11:24:26 +00:00
parent e0434f732c
commit 6581261a76
3 changed files with 23 additions and 1 deletions

View File

@@ -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>

View File

@@ -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

View File

@@ -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"