From: Vincent Le Gallic Date: Mon, 9 Dec 2013 11:41:26 +0000 (+0100) Subject: rangement X-Git-Url: http://gitweb.pimeys.fr/?p=scripts-20-100.git;a=commitdiff_plain;h=8721c7c2bbdd6c692f168bdce241ccdc7dc4cb59 rangement --- diff --git a/ftp/percent_decode.py b/ftp/percent_decode.py new file mode 100755 index 0000000..8fc51c9 --- /dev/null +++ b/ftp/percent_decode.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +"""Piper dedans un flux avec des %20 et autres cochonneries, + il ressortira lisible.""" + +__author__ = "Vincent Le Gallic " + +__license__ = "WTFPL" + +import urllib +import sys +import time + + +red="" +nocolor="" + +try: + while True: + 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) +except KeyboardInterrupt: + pass diff --git a/percent_decode.py b/percent_decode.py deleted file mode 100755 index 8fc51c9..0000000 --- a/percent_decode.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -"""Piper dedans un flux avec des %20 et autres cochonneries, - il ressortira lisible.""" - -__author__ = "Vincent Le Gallic " - -__license__ = "WTFPL" - -import urllib -import sys -import time - - -red="" -nocolor="" - -try: - while True: - 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) -except KeyboardInterrupt: - pass