From: Vincent Le Gallic Date: Mon, 9 Dec 2013 00:49:19 +0000 (+0100) Subject: [percent_decode] Pour colorer les PUT en rouge X-Git-Url: http://gitweb.pimeys.fr/?a=commitdiff_plain;h=6fcc8a56ce98cb00472ab54c892aa712a5de1b54;p=scripts-20-100.git [percent_decode] Pour colorer les PUT en rouge --- diff --git a/percent_decode.py b/percent_decode.py index fd0e583..8fc51c9 100755 --- a/percent_decode.py +++ b/percent_decode.py @@ -12,10 +12,17 @@ import urllib import sys import time + +red="" +nocolor="" + try: while True: l = sys.stdin.readline() if l != "": - sys.stdout.write(urllib.unquote(l)) + l = urllib.unquote(l) + if "--color" in sys.argv: + l = l.replace('"PUT ', '"%sPUT%s ' % (red, nocolor)) + sys.stdout.write(l) except KeyboardInterrupt: pass