[meld] Partial print port



commit 21b90f34fbce260faf9c26c0dfe35e90544ffa5d
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Oct 27 09:12:00 2012 +1000

    Partial print port

 meld/meldapp.py |    4 +++-
 meld/task.py    |   16 +++++++++-------
 2 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/meld/meldapp.py b/meld/meldapp.py
index 53e1c32..8b6df24 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -16,6 +16,8 @@
 ### Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
 ### USA.
 
+from __future__ import print_function
+
 import optparse
 import os
 from gettext import gettext as _
@@ -127,7 +129,7 @@ class MeldApp(gobject.GObject):
         open_paths = self.window.open_paths
         if options.newtab:
             if not dbus_app:
-                print _("D-Bus error; comparisons will open in a new window.")
+                print(_("D-Bus error; comparisons will open in a new window."))
             else:
                 # Note that we deliberately discard auto-compare and -merge
                 # options here; these are not supported via dbus yet.
diff --git a/meld/task.py b/meld/task.py
index 15b710e..a9feddc 100644
--- a/meld/task.py
+++ b/meld/task.py
@@ -15,11 +15,13 @@
 ### Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
 ### USA.
 
-"""Classes to implement scheduling for cooperative threads.
-"""
+"""Classes to implement scheduling for cooperative threads."""
+
+from __future__ import print_function
 
 import traceback
 
+
 class SchedulerBase(object):
     """Base class with common functionality for schedulers.
 
@@ -187,16 +189,16 @@ if __name__ == "__main__":
 
     def timetask(t):
         while time.time() - t < 1:
-            print "***"
+            print("***")
             time.sleep(0.1)
-        print "!!!"
+        print("!!!")
 
     def sayhello(x):
         for i in range(random.randint(2, 8)):
-            print "hello", x
+            print("hello", x)
             time.sleep(0.1)
             yield 1
-        print "end", x
+        print("end", x)
 
     s = RoundRobinScheduler()
     m.add_task(s)
@@ -206,4 +208,4 @@ if __name__ == "__main__":
     while s.tasks_pending():
         s.iteration()
     time.sleep(2)
-    print "***"
+    print("***")



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]