-
Notifications
You must be signed in to change notification settings - Fork 1
Sourcery refactored master branch #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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") | ||
Comment on lines
-54
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
|
||
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 "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
|
||
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)}') | ||
Comment on lines
-294
to
+291
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
dispatcher = RPCDispatcher() | ||
dispatcher.register_instance(StdIOHandler(), "ui_") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
PipeTransport.receive_message
refactored with the following changes:use-fstring-for-formatting
)