* morituri/common/program.py:
* morituri/rip/cd.py: Add load and eject device. Do so before and after ripping.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user