Release v0.14.1
This commit is contained in:
commit
3a2fcc975e
@ -4,6 +4,15 @@ Changelog
|
|||||||
|
|
||||||
This changelog is used to track all major changes to Mopidy.
|
This changelog is used to track all major changes to Mopidy.
|
||||||
|
|
||||||
|
v0.14.1 (2013-04-28)
|
||||||
|
====================
|
||||||
|
|
||||||
|
This release addresses an issue in v0.14.0 where the new
|
||||||
|
:option:`mopidy-convert-config` tool and the new :option:`mopidy --option`
|
||||||
|
command line option was broken because some string operations inadvertently
|
||||||
|
converted some byte strings to unicode.
|
||||||
|
|
||||||
|
|
||||||
v0.14.0 (2013-04-28)
|
v0.14.0 (2013-04-28)
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
|||||||
@ -23,4 +23,4 @@ if (isinstance(pykka.__version__, basestring)
|
|||||||
warnings.filterwarnings('ignore', 'could not open display')
|
warnings.filterwarnings('ignore', 'could not open display')
|
||||||
|
|
||||||
|
|
||||||
__version__ = '0.14.0'
|
__version__ = '0.14.1'
|
||||||
|
|||||||
@ -141,8 +141,8 @@ def _format(config, comments, schemas, display):
|
|||||||
|
|
||||||
def parse_override(override):
|
def parse_override(override):
|
||||||
"""Parse ``section/key=value`` command line overrides"""
|
"""Parse ``section/key=value`` command line overrides"""
|
||||||
section, remainder = override.split('/', 1)
|
section, remainder = override.split(b'/', 1)
|
||||||
key, value = remainder.split('=', 1)
|
key, value = remainder.split(b'=', 1)
|
||||||
return (section.strip(), key.strip(), value.strip())
|
return (section.strip(), key.strip(), value.strip())
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ from mopidy.utils import path
|
|||||||
|
|
||||||
|
|
||||||
def load():
|
def load():
|
||||||
settings_file = path.expand_path('$XDG_CONFIG_DIR/mopidy/settings.py')
|
settings_file = path.expand_path(b'$XDG_CONFIG_DIR/mopidy/settings.py')
|
||||||
print 'Checking %s' % settings_file
|
print 'Checking %s' % settings_file
|
||||||
|
|
||||||
setting_globals = {}
|
setting_globals = {}
|
||||||
@ -109,7 +109,7 @@ def main():
|
|||||||
print b'Converted config:\n'
|
print b'Converted config:\n'
|
||||||
print config_lib.format(config, extensions)
|
print config_lib.format(config, extensions)
|
||||||
|
|
||||||
conf_file = path.expand_path('$XDG_CONFIG_DIR/mopidy/mopidy.conf')
|
conf_file = path.expand_path(b'$XDG_CONFIG_DIR/mopidy/mopidy.conf')
|
||||||
if os.path.exists(conf_file):
|
if os.path.exists(conf_file):
|
||||||
print '%s exists, exiting.' % conf_file
|
print '%s exists, exiting.' % conf_file
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
|||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
|
import sys
|
||||||
|
|
||||||
from mopidy.utils import path
|
from mopidy.utils import path
|
||||||
from mopidy.config import validators
|
from mopidy.config import validators
|
||||||
@ -254,6 +255,8 @@ class Path(ConfigValue):
|
|||||||
return ExpandedPath(value, expanded)
|
return ExpandedPath(value, expanded)
|
||||||
|
|
||||||
def serialize(self, value, display=False):
|
def serialize(self, value, display=False):
|
||||||
|
if isinstance(value, unicode):
|
||||||
|
value = value.encode(sys.getfilesystemencoding())
|
||||||
if isinstance(value, ExpandedPath):
|
if isinstance(value, ExpandedPath):
|
||||||
return value.original
|
return value.original
|
||||||
return value
|
return value
|
||||||
|
|||||||
@ -109,18 +109,24 @@ class ValidateTest(unittest.TestCase):
|
|||||||
|
|
||||||
class ParseOverrideTest(unittest.TestCase):
|
class ParseOverrideTest(unittest.TestCase):
|
||||||
def test_valid_override(self):
|
def test_valid_override(self):
|
||||||
expected = ('section', 'key', 'value')
|
expected = (b'section', b'key', b'value')
|
||||||
self.assertEqual(expected, config.parse_override('section/key=value'))
|
self.assertEqual(expected, config.parse_override(b'section/key=value'))
|
||||||
self.assertEqual(expected, config.parse_override('section/key=value '))
|
self.assertEqual(expected, config.parse_override(b'section/key=value '))
|
||||||
self.assertEqual(expected, config.parse_override('section/key =value'))
|
self.assertEqual(expected, config.parse_override(b'section/key =value'))
|
||||||
self.assertEqual(expected, config.parse_override('section /key=value'))
|
self.assertEqual(expected, config.parse_override(b'section /key=value'))
|
||||||
|
|
||||||
|
def test_valid_override_is_bytes(self):
|
||||||
|
section, key, value = config.parse_override(b'section/key=value')
|
||||||
|
self.assertIsInstance(section, bytes)
|
||||||
|
self.assertIsInstance(key, bytes)
|
||||||
|
self.assertIsInstance(value, bytes)
|
||||||
|
|
||||||
def test_empty_override(self):
|
def test_empty_override(self):
|
||||||
expected = ('section', 'key', '')
|
expected = ('section', 'key', '')
|
||||||
self.assertEqual(expected, config.parse_override('section/key='))
|
self.assertEqual(expected, config.parse_override(b'section/key='))
|
||||||
self.assertEqual(expected, config.parse_override('section/key= '))
|
self.assertEqual(expected, config.parse_override(b'section/key= '))
|
||||||
|
|
||||||
def test_invalid_override(self):
|
def test_invalid_override(self):
|
||||||
self.assertRaises(ValueError, config.parse_override, 'section/key')
|
self.assertRaises(ValueError, config.parse_override, b'section/key')
|
||||||
self.assertRaises(ValueError, config.parse_override, 'section=')
|
self.assertRaises(ValueError, config.parse_override, b'section=')
|
||||||
self.assertRaises(ValueError, config.parse_override, 'section')
|
self.assertRaises(ValueError, config.parse_override, b'section')
|
||||||
|
|||||||
@ -5,6 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import logging
|
import logging
|
||||||
import mock
|
import mock
|
||||||
import socket
|
import socket
|
||||||
|
import sys
|
||||||
|
|
||||||
from mopidy.config import types
|
from mopidy.config import types
|
||||||
|
|
||||||
@ -364,3 +365,10 @@ class PathTest(unittest.TestCase):
|
|||||||
def test_serialize_plain_string(self):
|
def test_serialize_plain_string(self):
|
||||||
value = types.Path()
|
value = types.Path()
|
||||||
self.assertEqual('path', value.serialize(b'path'))
|
self.assertEqual('path', value.serialize(b'path'))
|
||||||
|
|
||||||
|
def test_serialize_unicode_string(self):
|
||||||
|
value = types.Path()
|
||||||
|
expected = 'æøå'.encode(sys.getfilesystemencoding())
|
||||||
|
result = value.serialize('æøå')
|
||||||
|
self.assertEqual(expected, result)
|
||||||
|
self.assertIsInstance(result, bytes)
|
||||||
|
|||||||
@ -37,5 +37,6 @@ class VersionTest(unittest.TestCase):
|
|||||||
self.assertLess(SV('0.11.0'), SV('0.11.1'))
|
self.assertLess(SV('0.11.0'), SV('0.11.1'))
|
||||||
self.assertLess(SV('0.11.1'), SV('0.12.0'))
|
self.assertLess(SV('0.11.1'), SV('0.12.0'))
|
||||||
self.assertLess(SV('0.12.0'), SV('0.13.0'))
|
self.assertLess(SV('0.12.0'), SV('0.13.0'))
|
||||||
self.assertLess(SV('0.13.0'), SV(__version__))
|
self.assertLess(SV('0.13.0'), SV('0.14.0'))
|
||||||
self.assertLess(SV(__version__), SV('0.14.1'))
|
self.assertLess(SV('0.14.0'), SV(__version__))
|
||||||
|
self.assertLess(SV(__version__), SV('0.14.2'))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user