* morituri/rip/main.py:
Add the config object to the root command. * morituri/rip/offset.py: Save the drive's read offset when we find it.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2012-12-02 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* morituri/rip/main.py:
|
||||
Add the config object to the root command.
|
||||
* morituri/rip/offset.py:
|
||||
Save the drive's read offset when we find it.
|
||||
|
||||
2012-12-02 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* morituri.spec.in:
|
||||
|
||||
@@ -5,7 +5,7 @@ import os
|
||||
import sys
|
||||
import pkg_resources
|
||||
|
||||
from morituri.common import log, logcommand, common
|
||||
from morituri.common import log, logcommand, common, config
|
||||
|
||||
from morituri.rip import cd, offset, drive, image, accurip, debug
|
||||
|
||||
@@ -104,6 +104,8 @@ You can get help on subcommands by using the -h option to the subcommand.
|
||||
|
||||
self.record = options.record
|
||||
|
||||
self.config = config.Config()
|
||||
|
||||
def parse(self, argv):
|
||||
log.debug("morituri", "rip %s" % " ".join(argv))
|
||||
logcommand.LogCommand.parse(self, argv)
|
||||
|
||||
@@ -188,8 +188,7 @@ CD in the AccurateRip database."""
|
||||
count += 1
|
||||
|
||||
if count == len(table.tracks):
|
||||
self.stdout.write('\nRead offset of device is: %d.\n' %
|
||||
offset)
|
||||
self._foundOffset(device, offset)
|
||||
return 0
|
||||
else:
|
||||
self.stdout.write(
|
||||
@@ -225,6 +224,20 @@ CD in the AccurateRip database."""
|
||||
os.unlink(path)
|
||||
return "%08x" % t.checksum
|
||||
|
||||
def _foundOffset(self, device, offset):
|
||||
self.stdout.write('\nRead offset of device is: %d.\n' %
|
||||
offset)
|
||||
|
||||
info = drive.getDeviceInfo(device)
|
||||
if not info:
|
||||
return
|
||||
|
||||
self.stdout.write('Adding read offset to configuration file.\n')
|
||||
|
||||
self.getRootCommand().config.setReadOffset(info[0], info[1], info[2],
|
||||
offset)
|
||||
|
||||
|
||||
|
||||
class Offset(logcommand.LogCommand):
|
||||
summary = "handle drive offsets"
|
||||
|
||||
Reference in New Issue
Block a user