From d096db1e7c963684055768cbcbea92a3ae691c5e Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 2 Dec 2012 12:25:49 +0000 Subject: [PATCH] * morituri/rip/drive.py: rip drive list now shows configured read offset if applicable. --- ChangeLog | 5 +++++ morituri/rip/drive.py | 21 +++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index df751f3..5d60e1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-12-02 Thomas Vander Stichele + + * morituri/rip/drive.py: + rip drive list now shows configured read offset if applicable. + 2012-12-02 Thomas Vander Stichele * morituri/rip/cd.py: diff --git a/morituri/rip/drive.py b/morituri/rip/drive.py index b5f2b6c..33e5998 100644 --- a/morituri/rip/drive.py +++ b/morituri/rip/drive.py @@ -31,9 +31,9 @@ class List(logcommand.LogCommand): paths = drive.getAllDevicePaths() if not paths: - print 'No drives found.' - print 'Create /dev/cdrom if you have a CD drive, ' - print 'or install pycdio for better detection.' + self.stdout.write('No drives found.\n') + self.stdout.write('Create /dev/cdrom if you have a CD drive, \n') + self.stdout.write('or install pycdio for better detection.\n') return @@ -46,11 +46,20 @@ class List(logcommand.LogCommand): for path in paths: vendor, model, release = drive.getDeviceInfo(path) - print "drive: %s, vendor: %s, model: %s, release: %s" % ( - path, vendor, model, release) + self.stdout.write( + "drive: %s, vendor: %s, model: %s, release: %s\n" % ( + path, vendor, model, release)) + + try: + offset = self.getRootCommand().config.getReadOffset( + vendor, model, release) + self.stdout.write( + " Configured read offset: %d\n" % offset) + except KeyError: + pass if not paths: - print 'No drives found.' + self.stdout.write('No drives found.\n') class Drive(logcommand.LogCommand):