-# Copyright (C) 2009-2012 EDF R&D
+# Copyright (C) 2009-2019 EDF R&D
#
# 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.
+# 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
try:
from string import Template
except:
- from compat import Template,set
+ from module_generator.compat import Template,set
pyCompo="""
import sys,traceback,os
import dsccalcium
import SALOME
import Engines
-import cPickle
+import pickle
try:
import numpy
if __name__ == '__main__':
from omniORB import CORBA
- print sys.argv
+ print( sys.argv)
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
poa = orb.resolve_initial_references("RootPOA")
- print "ORB and POA initialized",orb,poa
+ print( "ORB and POA initialized",orb,poa)
sys.stdout.flush()
sys.stderr.flush()
compo=${component}(orb,poa,container,containerName, instanceName, "${component}")
comp_o = compo._this()
comp_iors = orb.object_to_string(comp_o)
- print "ior ${component}",comp_iors
+ print( "ior ${component}",comp_iors)
sys.stdout.flush()
sys.stderr.flush()
poaManager.activate()
orb.run()
- print "fin du composant ${component} standalone"
+ print( "fin du composant ${component} standalone")
"""
pyinitCEXEService=pyinitService
pyinitEXEService=pyinitService
+# CMakeLists.txt in src/<component> for a python component
+# template parameters:
+# sources: source files, separated by spaces
+cmake_src_compo_py="""
+# scripts / static
+SET(_bin_SCRIPTS
+ ${sources}
+)
+
+# --- rules ---
+SALOME_INSTALL_SCRIPTS("$${_bin_SCRIPTS}" $${SALOME_INSTALL_SCRIPT_PYTHON})
+"""
+cmake_src_compo_py=Template(cmake_src_compo_py)
\ No newline at end of file