From: Vincent Le Gallic Date: Mon, 20 Nov 2017 15:39:36 +0000 (+0100) Subject: percent_decode quitte sans hold + option pour --follow X-Git-Url: http://gitweb.pimeys.fr/?p=scripts-20-100.git;a=commitdiff_plain;h=9954d72a64c5ea3749e4f1ba5ce80e80e746222f percent_decode quitte sans hold + option pour --follow --- 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