From e2c678930cd241af36ecca4f542af0b1fb34de24 Mon Sep 17 00:00:00 2001 From: morrieinmaas <2718281@protonmail.ch> Date: Sat, 18 May 2019 15:55:30 -0400 Subject: [PATCH 1/2] Closes #330 Changed default choice from No to Yes for wormhole receive --- src/wormhole/cli/cmd_receive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wormhole/cli/cmd_receive.py b/src/wormhole/cli/cmd_receive.py index 3e4668df..e65c83c9 100644 --- a/src/wormhole/cli/cmd_receive.py +++ b/src/wormhole/cli/cmd_receive.py @@ -369,8 +369,8 @@ def _remove_existing(self, path): def _ask_permission(self): with self.args.timing.add("permission", waiting="user") as t: while True and not self.args.accept_file: - ok = six.moves.input("ok? (y/N): ") - if ok.lower().startswith("y"): + ok = six.moves.input("ok? (Y/n): ") + if not ok.lower().startswith("n"): if os.path.exists(self.abs_destname): self._remove_existing(self.abs_destname) break From 58cf584fb0db60648061ef71106064efdca77c38 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 29 May 2019 23:32:02 -0700 Subject: [PATCH 2/2] cmd_receive: treat 'quit' or other non- yes/no answers as "no" So "yes" or "Yes" or "y" or "Y" or anything else that starts with y/Y means yes, and a bare newline means yes, but anything else means no. --- src/wormhole/cli/cmd_receive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wormhole/cli/cmd_receive.py b/src/wormhole/cli/cmd_receive.py index e65c83c9..e5e11c03 100644 --- a/src/wormhole/cli/cmd_receive.py +++ b/src/wormhole/cli/cmd_receive.py @@ -370,7 +370,7 @@ def _ask_permission(self): with self.args.timing.add("permission", waiting="user") as t: while True and not self.args.accept_file: ok = six.moves.input("ok? (Y/n): ") - if not ok.lower().startswith("n"): + if ok.lower().startswith("y") or len(ok) == 0: if os.path.exists(self.abs_destname): self._remove_existing(self.abs_destname) break