* 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:
Thomas Vander Stichele
2012-12-02 12:18:15 +00:00
parent 445708b4ea
commit 1e980db4ef
3 changed files with 25 additions and 3 deletions

View File

@@ -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"