From 9954d72a64c5ea3749e4f1ba5ce80e80e746222f Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Mon, 20 Nov 2017 16:39:36 +0100 Subject: [PATCH] percent_decode quitte sans hold + option pour --follow --- ftp/percent_decode.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ftp/percent_decode.py b/ftp/percent_decode.py index 8fc51c9..5621e3f 100755 --- a/ftp/percent_decode.py +++ b/ftp/percent_decode.py @@ -16,13 +16,20 @@ import time red="" nocolor="" +FOLLOW = False +if "-f" in sys.argv: + FOLLOW = True + +run = True try: - while True: + while run: l = sys.stdin.readline() if l != "": l = urllib.unquote(l) if "--color" in sys.argv: l = l.replace('"PUT ', '"%sPUT%s ' % (red, nocolor)) sys.stdout.write(l) + elif not FOLLOW: + run = False except KeyboardInterrupt: pass -- 2.39.2