]> gitweb.pimeys.fr Git - today.git/commitdiff
Maintenant on supporte d'être pipé dans un grep
authorVincent Le Gallic <legallic@crans.org>
Sat, 29 Jun 2013 22:43:41 +0000 (00:43 +0200)
committerVincent Le Gallic <legallic@crans.org>
Sat, 29 Jun 2013 22:43:41 +0000 (00:43 +0200)
today.py

index 4522d0770e02e0f7e0fc561afbb72d487bc97650..8594fdb47ed00228982a3979207a3627f0fa6a69 100755 (executable)
--- 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")