From c6cd8d35ab7ec72cf65d5b95a056a6495c115aae Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Fri, 28 Jul 2023 16:46:23 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- cmd/clef/pythonsigner.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/cmd/clef/pythonsigner.py b/cmd/clef/pythonsigner.py index b9ea1e406a89..d194ce9ea64c 100644 --- a/cmd/clef/pythonsigner.py +++ b/cmd/clef/pythonsigner.py @@ -46,13 +46,13 @@ def __init__(self, input, output): def receive_message(self): data = self.input.readline() - print(">> {}".format(data)) + print(f">> {data}") return None, urlparse.unquote(data) def send_reply(self, context, reply): reply = str(reply, "utf-8") - print("<< {}".format(reply)) - self.output.write("{}\n".format(reply)) + print(f"<< {reply}") + self.output.write(f"{reply}\n") def sanitize(txt, limit=100): @@ -281,17 +281,14 @@ def onInputRequired(self, req): ) ) isPassword = req.get("isPassword") - if not isPassword: - return {"text": input()} - - return "" + return {"text": input()} if not isPassword else "" def main(args): cmd = ["clef", "--stdio-ui"] if len(args) > 0 and args[0] == "test": cmd.extend(["--stdio-ui-test"]) - print("cmd: {}".format(" ".join(cmd))) + print(f'cmd: {" ".join(cmd)}') dispatcher = RPCDispatcher() dispatcher.register_instance(StdIOHandler(), "ui_")