From: Vincent Le Gallic Date: Sat, 29 Jun 2013 22:43:41 +0000 (+0200) Subject: Maintenant on supporte d'être pipé dans un grep X-Git-Url: http://gitweb.pimeys.fr/?p=today.git;a=commitdiff_plain;h=4a6815aa058ec0adc58ed4afc160c28f83275d6d Maintenant on supporte d'être pipé dans un grep --- diff --git a/today.py b/today.py index 4522d07..8594fdb 100755 --- a/today.py +++ b/today.py @@ -369,7 +369,7 @@ def initialize(): for ifile in range(len(files)): namefile = files[ifile] if os.path.isfile(namefile): - print "%s exists, skipping." % (namefile,) + print (u"%s exists, skipping." % (namefile,)).encode("utf-8") else: f = open(namefile, "w") f.write(contents[ifile].encode("utf-8")) @@ -389,7 +389,7 @@ def sync(): out = proc.stdout.read() newdict = json.loads(out) update_last_seen(newdict) - print u"Nouvel état : %r" % newdict + print (u"Nouvel état : %r" % newdict).encode("utf-8") @@ -439,4 +439,4 @@ if __name__ == "__main__": args = sys.argv[2:] output = ACTIONS[commande](*args) if output: - print output + print output.encode("utf-8")