Salome HOME
updated copyright message
[modules/kernel.git] / bin / appliskel / tests / salomeInstance / instances.py
old mode 100644 (file)
new mode 100755 (executable)
index 8184677..d34230f
@@ -1,4 +1,5 @@
-# Copyright (C) 2015-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+#!/usr/bin/env python3
+# Copyright (C) 2015-2023  CEA, EDF, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -23,7 +24,7 @@ import multiprocessing
 def new_instance(running_instances):
   from salome_instance import SalomeInstance
   instance = SalomeInstance.start()
-  print "Instance created and now running on port", instance.get_port()
+  print("Instance created and now running on port", instance.get_port())
   running_instances.put(instance)
 #
 
@@ -41,7 +42,7 @@ class TestLauncher(unittest.TestCase):
   def __terminateInstances(self, running_instances):
     while not running_instances.empty():
       instance = running_instances.get()
-      print "Terminate instance running on port", instance.get_port()
+      print("Terminate instance running on port", instance.get_port())
       instance.stop()
   #
 
@@ -91,19 +92,19 @@ class TestLauncher(unittest.TestCase):
 
     # Connect to one instance
     import runConsole
-    port = all_instances[len(all_instances)/2].get_port()
-    print "Connect to instance running on port", port
+    port = all_instances[len(all_instances)//2].get_port()
+    print("Connect to instance running on port", port)
     self.__connectToInstance(port)
 
     # Connect to another instance
     import runConsole
-    port = all_instances[len(all_instances)/4].get_port()
-    print "Connect to instance running on port", port
+    port = all_instances[len(all_instances)//4].get_port()
+    print("Connect to instance running on port", port)
     self.__connectToInstance(port)
 
     # Terminate instances
     for instance in all_instances:
-      print "Terminate instance running on port", instance.get_port()
+      print("Terminate instance running on port", instance.get_port())
       instance.stop()
   #