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"