sisoe24 / Nuke-Tools-ST

Consider using f-strings PYL-C0209
Performance
Minor
a year agoa year old
Formatting a regular string which could be a f-string
119        except socket.error as err:
120            output = _err_msg("UnknownError: {}".format(err), hostname, port)
121        except Exception as err:  # skipcq: PYL-W0703
122            output = "UnknownException: {}".format(err)123        else:
124            _socket.sendall(bytearray(data, encoding='utf-8'))
125
Formatting a regular string which could be a f-string
117        except socket.timeout:
118            output = _err_msg("ConnectionTimeoutError", hostname, port)
119        except socket.error as err:
120            output = _err_msg("UnknownError: {}".format(err), hostname, port)121        except Exception as err:  # skipcq: PYL-W0703
122            output = "UnknownException: {}".format(err)
123        else:
Formatting a regular string which could be a f-string
 81       str: the error message created.
 82    """
 83    err = (
 84        "{}. {}:{}.\n".format(err, hostname, port) 85        + 'Check Sublime settings if you specified manually the address,'
 86        ' or check if plugin inside Nuke is connected.'
 87    )
Formatting a regular string which could be a f-string
 25    """
 26    now = datetime.now()
 27    time = now.strftime("%H:%M:%S")
 28    return "[{}] [NukeTools] {}".format(time, text) 29
 30
 31def nss_ip_port():