Files
whipper-gui/bin/rip.in
Thomas Vander Stichele ad1cf0ff84 Handle broken pycdio 0.18
2013-01-28 22:13:25 +01:00

46 lines
1.2 KiB
Python
Executable File

#!/usr/bin/env python
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
import sys
# /usr/local/bin typically is on PATH, making it possible to find this file.
# However, /usr/local/lib/pythonX.Y/*-packages usually isn't, so let's
# make sure here it is.
if not "@PYTHONLIBDIR@" in sys.path:
sys.path.append("@PYTHONLIBDIR@")
# first try to import morituri
try:
import morituri
except ImportError:
sys.stderr.write('''The rip binary cannot find its python package.
This means that the 'morituri' directory containing __init__.py is not on your
PYTHONPATH.
Typically this is due to a broken install.
Please fix the problem, and verify that it is fixed by starting python and
typing:
>>> import morituri
and assure it doesn't raise an exception.
''')
sys.exit(1)
# now load the main function
try:
from morituri.common import deps
from morituri.extern.deps import deps as edeps
h = deps.DepsHandler()
h.validate()
from morituri.rip import main
sys.exit(main.main(sys.argv[1:]))
except ImportError, e:
h.handleImportError(e)
sys.exit(1)
except edeps.DependencyError:
sys.stderr.write('rip: please fix the dependency and try again.\n')
sys.exit(1)