* morituri/common/config.py:
* morituri/rip/cd.py: * morituri/test/test_common_config.py: strip model/release too.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2013-01-02 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* morituri/common/config.py:
|
||||
* morituri/rip/cd.py:
|
||||
* morituri/test/test_common_config.py:
|
||||
strip model/release too.
|
||||
|
||||
2012-12-23 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* morituri/common/program.py:
|
||||
|
||||
@@ -119,9 +119,9 @@ class Config(log.Loggable):
|
||||
key, locals()[key], conf[key]))
|
||||
if vendor.strip() != conf['vendor']:
|
||||
continue
|
||||
if model != conf['model']:
|
||||
if model.strip() != conf['model']:
|
||||
continue
|
||||
if release != conf['release']:
|
||||
if release.strip() != conf['release']:
|
||||
continue
|
||||
|
||||
return name
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
import os
|
||||
import math
|
||||
import ConfigParser
|
||||
|
||||
import gobject
|
||||
gobject.threads_init()
|
||||
@@ -225,7 +226,7 @@ Log files will log the path to tracks relative to this directory.
|
||||
try:
|
||||
prog.result.cdparanoiaDefeatsCache = self.getRootCommand(
|
||||
).config.getDefeatsCache(*info)
|
||||
except KeyError:
|
||||
except (KeyError, ConfigParser.NoOptionError):
|
||||
pass
|
||||
prog.result.offset = int(self.options.offset)
|
||||
prog.result.artist = prog.metadata and prog.metadata.artist \
|
||||
|
||||
@@ -34,3 +34,19 @@ class OffsetTestCase(tcommon.TestCase):
|
||||
offset = self._config.getReadOffset('PLEXTOR ', 'DVDR PX-L890SA',
|
||||
'1.05')
|
||||
self.assertEquals(offset, 6)
|
||||
|
||||
def testAddReadOffsetSpaced(self):
|
||||
self.assertRaises(KeyError,
|
||||
self._config.getReadOffset, 'Slimtype', 'eSAU208 2 ', 'ML03')
|
||||
self._config.setReadOffset('Slimtype', 'eSAU208 2 ', 'ML03', 6)
|
||||
|
||||
# getting it from memory should work
|
||||
offset = self._config.getReadOffset(
|
||||
'Slimtype', 'eSAU208 2 ', 'ML03')
|
||||
self.assertEquals(offset, 6)
|
||||
|
||||
# and so should getting it after reading it again
|
||||
self._config.open()
|
||||
offset = self._config.getReadOffset(
|
||||
'Slimtype', 'eSAU208 2 ', 'ML03')
|
||||
self.assertEquals(offset, 6)
|
||||
|
||||
Reference in New Issue
Block a user