Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring whether to auto close the drive's tray #505

Merged
merged 1 commit into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions man/whipper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ Options
| **-e** | **--eject** *never failure success always*
| When to eject disc (default: success)

| **-c** | **--drive-auto-close**
| Whether to auto close the drive's tray before reading a CD
| (default: True)

| **-R** | **--record**
| Record API requests for playback

Expand Down
3 changes: 2 additions & 1 deletion whipper/command/cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def do(self):
self.device = self.options.device
logger.info('checking device %s', self.device)

utils.load_device(self.device)
if self.options.drive_auto_close is True:
utils.load_device(self.device)
utils.unmount_device(self.device)

# first, read the normal TOC, which is fast
Expand Down
6 changes: 5 additions & 1 deletion whipper/command/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ def add_arguments(self):
default="success",
choices=('never', 'failure',
'success', 'always'),
help="when to eject disc (default: success)")
help="when to eject disc (default: success)"),
self.parser.add_argument('-c', '--drive-auto-close', action="store",
dest="drive_auto_close", default=True,
help="whether to auto close the drive's "
"tray before reading a CD (default: True)")

def handle_arguments(self):
if self.options.help:
Expand Down
3 changes: 2 additions & 1 deletion whipper/command/offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def do(self):
# if necessary, load and unmount
logger.info('checking device %s', device)

utils.load_device(device)
if self.options.drive_auto_close is True:
utils.load_device(device)
utils.unmount_device(device)

# first get the Table Of Contents of the CD
Expand Down