extern "C" void HandleServerSideSignals(CORBA::ORB_ptr theORB);
+#if PY_VERSION_HEX < 0x03050000
+static wchar_t*
+Py_DecodeLocale(const char *arg, size_t *size)
+{
+ return _Py_char2wchar(arg, size);
+}
+#endif
+
int main(int argc, char* argv[])
{
#ifdef HAVE_MPI2
}
else
{
+ wchar_t **changed_argv = new wchar_t*[argc];
+ for (int i = 0; i < argc; i++) {
+ changed_argv[i] = Py_DecodeLocale(argv[i], NULL);
+ }
Py_Initialize() ;
- PySys_SetArgv( argc , argv ) ;
+ PySys_SetArgv( argc , changed_argv ) ;
}
char *containerName = "";
def eval(self, val):
self.beginService( 'FactorialComponent eval' )
- print "eval :",val
+ print("eval :",val)
if (val < 0):
- raise ArgumentError("factorial must be positive, not " + `val`)
+ raise ArgumentError("factorial must be positive, not " + repr(val))
if (val < 2):
- print "eval return",val
+ print("eval return",val)
self.sendMessage( NOTIF_STEP , "Done" )
self.endService( 'FactorialComponent eval' )
return val
else:
val1 = self.eval(val-1)
self.sendMessage( NOTIF_TRACE , "One More Time" )
- print "eval return",val," * ",val1
+ print("eval return",val," * ",val1)
return val * val1
def sigma(self, val):
self.beginService( 'FactorialComponent sigma' )
- print "sigma :",val
+ print("sigma :",val)
if (val < 0):
- raise ArgumentError("sigma must be positive, not " + `val`)
+ raise ArgumentError("sigma must be positive, not " + repr(val))
i = 0
while i < 10000 :
n = 1
s = s + n
n = n + 1
i = i + 1
- print "sigma returns",s
+ print("sigma returns",s)
self.endService( 'FactorialComponent sigma' )
return s
def __init__(self, orb, poa, this, containerName, instanceName, interfaceName):
SALOME_ComponentPy_i.__init__(self, orb, poa, this, containerName,
instanceName, interfaceName, False)
- print "FactorialComponent::__init__"
+ print("FactorialComponent::__init__")
extern "C" void HandleServerSideSignals(CORBA::ORB_ptr theORB);
+
+#if PY_VERSION_HEX < 0x03050000
+static wchar_t*
+Py_DecodeLocale(const char *arg, size_t *size)
+{
+ return _Py_char2wchar(arg, size);
+}
+#endif
+
int main(int argc, char* argv[])
{
#ifdef HAVE_MPI2
}
else
{
+ wchar_t **changed_argv = new wchar_t*[argc];
+ for (int i = 0; i < argc; i++) {
+ changed_argv[i] = Py_DecodeLocale(argv[i], NULL);
+ }
Py_Initialize() ;
- PySys_SetArgv( argc , argv ) ;
+ PySys_SetArgv( argc , changed_argv ) ;
}
char *containerName = "";
# see salome_shared_modules.py
# (avoids incomplete import at run time)
-print "============== import SuperVisionTest ======================="
+print("============== import SuperVisionTest =======================")
import SuperVisionTest
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
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 ) :
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 ):
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, 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