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

Fix issue #23 #32

Merged
merged 2 commits into from
Aug 28, 2016
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: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ REQUIREMENTS
- GStreamer and its python bindings, for encoding
- gstreamer0.10-base-plugins >= 0.10.22 for appsink
- gstreamer0.10-good-plugins for wav encoding (it depends on the Linux distro used)
- python musicbrainz2, for metadata lookup
- python musicbrainzngs, for metadata lookup
- python-setuptools, for plugin support
- python-cddb, for showing but not using disc info if not in MusicBrainz
- pycdio, for drive identification (optional)
- pycdio, for drive identification (it can be overridden placing a blank file named `PYCDIO_IGNORE` into whipper's config path)
- Required for drive offset and caching behavior to be stored in the config file

Additionally, if you're building from a git checkout:
Expand Down
33 changes: 22 additions & 11 deletions morituri/rip/cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
gobject.threads_init()

from morituri.common import logcommand, common, accurip, gstreamer
from morituri.common import drive, program, task
from morituri.common import drive, program, task, directory
from morituri.result import result
from morituri.program import cdrdao, cdparanoia
from morituri.rip import common as rcommon
Expand Down Expand Up @@ -168,11 +168,20 @@ def do(self, args):
self.program.result.release = \
cdio.Device(self.device).get_hwinfo()
except ImportError:
self.stdout.write(
'WARNING: pycdio not installed, cannot identify drive\n')
self.program.result.vendor = 'Unknown'
self.program.result.model = 'Unknown'
self.program.result.release = 'Unknown'
d = directory.Directory()
path = os.path.dirname(d.getConfig())
fullPath = os.path.join(path, 'PYCDIO_IGNORE')
if os.path.isfile(fullPath):
self.stdout.write(
'WARNING: pycdio not installed, cannot identify drive '
'(hard dependency overridden)\n')
self.program.result.vendor = 'Unknown'
self.program.result.model = 'Unknown'
self.program.result.release = 'Unknown'
else:
raise ImportError("Pycdio module import failed.\n"
"This is a hard dependency: if not "
"available please install it")

self.doCommand()

Expand Down Expand Up @@ -273,11 +282,13 @@ def handleOptions(self, options):
pass

if options.offset is None:
options.offset = 0
self.stdout.write("""WARNING: using default offset %d.
Install pycdio and run 'rip offset find' to detect your drive's offset.
""" %
options.offset)
raise ValueError("Drive offset is unconfigured.\n"
"Please install pycdio and run 'rip offset "
"find' to detect your drive's offset or set it "
"manually in the configuration file. It can "
"also be specified at runtime using the "
"'--offset=value' argument")

if self.options.output_directory is None:
self.options.output_directory = os.getcwd()
else:
Expand Down