implement remarks for #481, also add scheme as requested in #472

This commit is contained in:
Alexandre Petitjean 2013-07-30 08:17:10 +02:00
parent 05733cf844
commit f9da3fe3e9
4 changed files with 9 additions and 5 deletions

View File

@ -36,9 +36,11 @@ class SpotifySessionManager(process.BaseThread, PyspotifySessionManager):
full_proxy = ''
if config['proxy']['hostname']:
full_proxy = config['proxy']['hostname']
# Add proxy port only if available
# Add proxy port and scheme only if available
if config['proxy']['port']:
full_proxy = full_proxy + ':' + str(config['proxy']['port'])
full_proxy += ':' + str(config['proxy']['port'])
if config['proxy']['scheme']:
full_proxy = config['proxy']['scheme'] + "://" + full_proxy
PyspotifySessionManager.__init__(
self, config['spotify']['username'], config['spotify']['password'],

View File

@ -26,10 +26,12 @@ _audio_schema['mixer_track'] = String(optional=True)
_audio_schema['output'] = String()
_proxy_schema = ConfigSchema('proxy')
_proxy_schema['scheme'] = String(optional=True,
choices=['', 'https', 'socks4', 'socks5'])
_proxy_schema['hostname'] = Hostname(optional=True)
_proxy_schema['port'] = Port()
_proxy_schema['username'] = String(optional=True)
_proxy_schema['password'] = Secret(optional=True)
_proxy_schema['port'] = Port()
# NOTE: if multiple outputs ever comes something like LogLevelConfigSchema
#_outputs_schema = config.AudioOutputConfigSchema()

View File

@ -13,7 +13,8 @@ mixer_track =
output = autoaudiosink
[proxy]
scheme =
hostname =
port =
username =
password =
port =

View File

@ -245,7 +245,6 @@ class Port(Integer):
return value
class Path(ConfigValue):
"""File system path