* morituri/rip/main.py: * morituri/rip/drive.py (added): Add 'rip drive list' command to list available drives. * morituri/common/accurip.py: Add force. * morituri/rip/cd.py: Add --output-directory argument.
50 lines
1.2 KiB
Python
50 lines
1.2 KiB
Python
# -*- Mode: Python -*-
|
|
# vi:si:et:sw=4:sts=4:ts=4
|
|
|
|
import sys
|
|
|
|
from morituri.common import log, logcommand
|
|
from morituri.rip import cd, offset, drive
|
|
|
|
def main(argv):
|
|
c = Rip()
|
|
try:
|
|
ret = c.parse(argv)
|
|
except SystemError, e:
|
|
sys.stderr.write('rip: error: %s\n' % e.args)
|
|
return 255
|
|
except ImportError, e:
|
|
# FIXME: decide how to handle
|
|
raise
|
|
# deps.handleImportError(e)
|
|
# ret = -1
|
|
|
|
if ret is None:
|
|
return 0
|
|
|
|
return ret
|
|
|
|
class Rip(logcommand.LogCommand):
|
|
usage = "%prog %command"
|
|
description = """Rip rips CD's.
|
|
|
|
Rip gives you a tree of subcommands to work with.
|
|
You can get help on subcommands by using the -h option to the subcommand.
|
|
"""
|
|
|
|
subCommandClasses = [cd.CD, drive.Drive, offset.Offset, ]
|
|
|
|
def addOptions(self):
|
|
# FIXME: is this the right place ?
|
|
log.init()
|
|
|
|
self.parser.add_option('-v', '--version',
|
|
action="store_true", dest="version",
|
|
help="show version information")
|
|
|
|
def handleOptions(self, options):
|
|
if options.version:
|
|
from morituri.configure import configure
|
|
print "rip %s" % configure.version
|
|
sys.exit(0)
|