Salome HOME
Copyright update 2021
[samples/component.git] / src / SyrControlComponent / SyrControlComponent.py
index a0c3b8b40e16fd14ed3b9b35f7d93b1055316ed5..4b0add8f4b47a165e53e75c2b8d8bac6d1e100aa 100644 (file)
@@ -1,29 +1,30 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
+# Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2005  CEA/DEN, EDF R&D
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#  Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : SyrControlComponent.py
 #  Author : Jean Rahuel
 #  Module : SuperVisionTest
-
+#
 import os
 import sys
 import time
@@ -95,7 +96,7 @@ class SyrControlComponent( SuperVisionTest__POA.SyrControlComponent, SALOME_Comp
             if iN < max :
                 N = iN + 1
                 OutLoop = 1
-        print 'SyrControlComponent LOOPN InLoop iN OutLoop N',InLoop,iN,OutLoop,N
+        print('SyrControlComponent LOOPN InLoop iN OutLoop N',InLoop,iN,OutLoop,N)
         self.endService( 'SyrControlComponent LOOPN' )
         return OutLoop,N,0
 
@@ -105,7 +106,7 @@ class SyrControlComponent( SuperVisionTest__POA.SyrControlComponent, SALOME_Comp
             OutLoop = 1
         else :
             OutLoop = 0
-        print 'SyrControlComponent WHILENOTONE OutLoop N',OutLoop,N
+        print('SyrControlComponent WHILENOTONE OutLoop N',OutLoop,N)
         return OutLoop
 
     def IFNOTEVEN( self , N ) :
@@ -113,7 +114,7 @@ class SyrControlComponent( SuperVisionTest__POA.SyrControlComponent, SALOME_Comp
         Odd = 0
         if Even == 0 :
             Odd = 1
-        print 'SyrControlComponent IFNOTEVEN Odd Even N',Odd,Even,N
+        print('SyrControlComponent IFNOTEVEN Odd Even N',Odd,Even,N)
         return Odd,Even
 
     def LOOPi( self , InLoop , ii ):
@@ -126,17 +127,21 @@ class SyrControlComponent( SuperVisionTest__POA.SyrControlComponent, SALOME_Comp
             if ii+1 < 2 :
                 i = ii + 1
                 OutLoop = 1
-        print 'SyrControlComponent LOOPi InLoop ii OutLoop i',InLoop,ii,OutLoop,i
+        print('SyrControlComponent LOOPi InLoop ii OutLoop i',InLoop,ii,OutLoop,i)
         return OutLoop,i
 
     def WHILEEVEN( self , N ) :
         OutLoop = self.Syr.C_ISEVEN( N )
-        print 'SyrControlComponent WHILEEVEN OutLoop N',OutLoop,N
+        print('SyrControlComponent WHILEEVEN OutLoop N',OutLoop,N)
         return OutLoop 
 
     def __init__(self, orb, poa, this, containerName, instanceName, interfaceName):
         SALOME_ComponentPy_i.__init__(self, orb, poa, this, containerName,
-                                      instanceName, interfaceName, 1)
+                                      instanceName, interfaceName, True)
         self.Syr = lcc.FindOrLoadComponent( 'FactoryServer' , 'SyrComponent' )
-        print "SyrControlComponent::__init__",dir(self.Syr)
+        print("SyrControlComponent::__init__",dir(self.Syr))
+
+    def getVersion( self ):
+        import salome_version
+        return salome_version.getVersion("COMPONENT", True)