From 6aff8296bf25b26679bd5754dcf45de2465581c6 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Tue, 30 Jul 2013 11:32:41 +0200 Subject: [PATCH] Make rip cd info not eject. Fixes #35. --- morituri/rip/cd.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/morituri/rip/cd.py b/morituri/rip/cd.py index e927f62..c2c1a94 100644 --- a/morituri/rip/cd.py +++ b/morituri/rip/cd.py @@ -43,8 +43,11 @@ class _CD(logcommand.LogCommand): """ @type program: L{program.Program} + @ivar eject: whether to eject the drive after completing """ + eject = True + def addOptions(self): # FIXME: have a cache of these pickles somewhere self.parser.add_option('-T', '--toc-pickle', @@ -94,7 +97,7 @@ class _CD(logcommand.LogCommand): self.stdout.write('FreeDB identifies disc as %s\n' % cddbmd) # also used by rip cd info - if not getattr(self.options, 'unknown', False): + if not getattr(self.options, 'unknown', False) and self.eject: self.program.ejectDevice(self.device) return -1 @@ -150,7 +153,8 @@ class _CD(logcommand.LogCommand): self.doCommand() - self.program.ejectDevice(self.device) + if self.eject: + self.program.ejectDevice(self.device) def doCommand(self): pass @@ -159,6 +163,8 @@ class _CD(logcommand.LogCommand): class Info(_CD): summary = "retrieve information about the currently inserted CD" + eject = False + class Rip(_CD): summary = "rip CD"