correct default port config for proxy and deserialize function

This commit is contained in:
Alexandre Petitjean 2013-07-30 08:37:24 +02:00
parent f9da3fe3e9
commit bb3242d15a
2 changed files with 5 additions and 9 deletions

View File

@ -15,6 +15,6 @@ output = autoaudiosink
[proxy]
scheme =
hostname =
port =
port = http
username =
password =

View File

@ -227,10 +227,6 @@ class Port(Integer):
minimum=0, maximum=2 ** 16 - 1, choices=choices)
def deserialize(self, value):
# in case of no value is given, just return nothing
if not len(value):
return value
# now we can try to convert
try:
value = int(value)
except ValueError:
@ -238,10 +234,10 @@ class Port(Integer):
value = socket.getservbyname(value, 'tcp')
except socket.error:
raise ValueError('must be a valid port number')
else:
validators.validate_choice(value, self._choices)
validators.validate_minimum(value, self._minimum)
validators.validate_maximum(value, self._maximum)
validators.validate_choice(value, self._choices)
validators.validate_minimum(value, self._minimum)
validators.validate_maximum(value, self._maximum)
return value