diff --git a/lib/simple_config.py b/lib/simple_config.py index 71818e7f..3b747b0a 100644 --- a/lib/simple_config.py +++ b/lib/simple_config.py @@ -162,12 +162,12 @@ class SimpleConfig(PrintError): self.rename_config_keys(self.user_config, {'auto_cycle': 'auto_connect'}) 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') host, port, protocol = str(server_str).rsplit(':', 2) assert protocol in ('s', 't') 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) except BaseException: self._set_key_in_user_config('server', None) diff --git a/lib/util.py b/lib/util.py index d9eaea6c..db5fe896 100644 --- a/lib/util.py +++ b/lib/util.py @@ -77,8 +77,12 @@ class PrintError(object): return self.__class__.__name__ def print_error(self, *msg): + # only prints with --verbose flag print_error("[%s]" % self.diagnostic_name(), *msg) + def print_stderr(self, *msg): + print_stderr("[%s]" % self.diagnostic_name(), *msg) + def print_msg(self, *msg): print_msg("[%s]" % self.diagnostic_name(), *msg)