correct default port config for proxy and deserialize function
This commit is contained in:
parent
f9da3fe3e9
commit
bb3242d15a
@ -15,6 +15,6 @@ output = autoaudiosink
|
|||||||
[proxy]
|
[proxy]
|
||||||
scheme =
|
scheme =
|
||||||
hostname =
|
hostname =
|
||||||
port =
|
port = http
|
||||||
username =
|
username =
|
||||||
password =
|
password =
|
||||||
|
|||||||
@ -227,10 +227,6 @@ class Port(Integer):
|
|||||||
minimum=0, maximum=2 ** 16 - 1, choices=choices)
|
minimum=0, maximum=2 ** 16 - 1, choices=choices)
|
||||||
|
|
||||||
def deserialize(self, value):
|
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:
|
try:
|
||||||
value = int(value)
|
value = int(value)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
@ -238,10 +234,10 @@ class Port(Integer):
|
|||||||
value = socket.getservbyname(value, 'tcp')
|
value = socket.getservbyname(value, 'tcp')
|
||||||
except socket.error:
|
except socket.error:
|
||||||
raise ValueError('must be a valid port number')
|
raise ValueError('must be a valid port number')
|
||||||
else:
|
|
||||||
validators.validate_choice(value, self._choices)
|
validators.validate_choice(value, self._choices)
|
||||||
validators.validate_minimum(value, self._minimum)
|
validators.validate_minimum(value, self._minimum)
|
||||||
validators.validate_maximum(value, self._maximum)
|
validators.validate_maximum(value, self._maximum)
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user