config v2: change server protocol to :s instead of removing it
This commit is contained in:
@@ -162,12 +162,12 @@ class SimpleConfig(PrintError):
|
|||||||
self.rename_config_keys(self.user_config, {'auto_cycle': 'auto_connect'})
|
self.rename_config_keys(self.user_config, {'auto_cycle': 'auto_connect'})
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# migrate server string FROM host:port:proto TO host:port
|
# change server string FROM host:port:proto TO host:port:s
|
||||||
server_str = self.user_config.get('server')
|
server_str = self.user_config.get('server')
|
||||||
host, port, protocol = str(server_str).rsplit(':', 2)
|
host, port, protocol = str(server_str).rsplit(':', 2)
|
||||||
assert protocol in ('s', 't')
|
assert protocol in ('s', 't')
|
||||||
int(port) # Throw if cannot be converted to int
|
int(port) # Throw if cannot be converted to int
|
||||||
server_str = str('{}:{}'.format(host, port))
|
server_str = '{}:{}:s'.format(host, port)
|
||||||
self._set_key_in_user_config('server', server_str)
|
self._set_key_in_user_config('server', server_str)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
self._set_key_in_user_config('server', None)
|
self._set_key_in_user_config('server', None)
|
||||||
|
|||||||
@@ -77,8 +77,12 @@ class PrintError(object):
|
|||||||
return self.__class__.__name__
|
return self.__class__.__name__
|
||||||
|
|
||||||
def print_error(self, *msg):
|
def print_error(self, *msg):
|
||||||
|
# only prints with --verbose flag
|
||||||
print_error("[%s]" % self.diagnostic_name(), *msg)
|
print_error("[%s]" % self.diagnostic_name(), *msg)
|
||||||
|
|
||||||
|
def print_stderr(self, *msg):
|
||||||
|
print_stderr("[%s]" % self.diagnostic_name(), *msg)
|
||||||
|
|
||||||
def print_msg(self, *msg):
|
def print_msg(self, *msg):
|
||||||
print_msg("[%s]" % self.diagnostic_name(), *msg)
|
print_msg("[%s]" % self.diagnostic_name(), *msg)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user