Salome HOME
[PY3] Fix m4 macro for python 3
[modules/kernel.git] / src / KERNEL_PY / kernel / termcolor.py
index b7d99c778037b890d6379bdc407ab1fc82e94b8e..438d98b6786d79b300bd1ee31c51a67737084ae6 100644 (file)
@@ -41,9 +41,9 @@
 #  import sys
 #  from salome.kernel import termcolor
 #  if termcolor.canDisplayColor(sys.stdout):
-#      print termcolor.makeColoredMessage("Hello world!", termcolor.BLUE)
+#      print(termcolor.makeColoredMessage("Hello world!", termcolor.BLUE))
 #  else:
-#      print "Hello world!"
+#      print("Hello world!")
 #  \endcode
 #  \}
 
@@ -65,9 +65,9 @@ Example::
     import sys
     from salome.kernel import termcolor
     if termcolor.canDisplayColor(sys.stdout):
-        print termcolor.makeColoredMessage("Hello world!", termcolor.BLUE)
+        print(termcolor.makeColoredMessage("Hello world!", termcolor.BLUE))
     else:
-        print "Hello world!"
+        print("Hello world!")
 
 """
 
@@ -225,13 +225,13 @@ def TEST_termcolor():
     """Test function for termcolor module."""
     import sys
     if not canDisplayColor(sys.stdout):
-        print "Standard output does not support colors."
+        print("Standard output does not support colors.")
         return
-    print makeColoredMessage("This message must appear in blue.", BLUE)
-    print makeColoredMessage("This message must appear in red on green " +
-                             "background.", RED + GREEN_BG)
-    print makeColoredMessage("This message must appear in magenta and " +
-                             "crossed-out.", PURPLE + ['09'])
+    print(makeColoredMessage("This message must appear in blue.", BLUE))
+    print(makeColoredMessage("This message must appear in red on green " +
+                             "background.", RED + GREEN_BG))
+    print(makeColoredMessage("This message must appear in magenta and " +
+                             "crossed-out.", PURPLE + ['09']))
 
 
 # Main function only used to test the module