X-Git-Url: http://gitweb.pimeys.fr/?p=scripts-20-100.git;a=blobdiff_plain;f=ftp%2Fpercent_decode.py;fp=ftp%2Fpercent_decode.py;h=5621e3f5ced533d2ea0e34d2429e67e8ce52431e;hp=8fc51c9ef58e1f2c6ec9c64656522e9f74fab931;hb=9954d72a64c5ea3749e4f1ba5ce80e80e746222f;hpb=39a79075b929ee1891b058f609f50e1eac230aa9 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