From 6fcc8a56ce98cb00472ab54c892aa712a5de1b54 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Mon, 9 Dec 2013 01:49:19 +0100 Subject: [PATCH] [percent_decode] Pour colorer les PUT en rouge --- percent_decode.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.39.2