from salomeLauncherUtils import SalomeRunnerException
from salomeLauncherUtils import getScriptsAndArgs, formatScriptsAndArgs
+def usage():
+ #exeName = os.path.splitext(os.path.basename(__file__))[0]
+
+ msg = '''\
+Usage: salome [command] [options] [--config=file1,...,filen]
+
+Commands:
+ start Launches SALOME virtual application [DEFAULT]
+ shell Executes a script under SALOME application environment
+ connect Connects a Python console to the active SALOME session
+ killall Kill all SALOME running sessions
+ info Display some information about SALOME
+ help Show this message
+ coffee Yes! SALOME can also make coffee!!"
+
+Use salome start --help or salome shell --help
+to show help on start and shell commands.
+'''
+
+ print msg
+#
+
"""
The SalomeRunner class in an API to configure SALOME environment then
start SALOME using a single python command.
# This begins the private section #
###################################
- def _usage(self, unused=[]):
- #exeName = os.path.splitext(os.path.basename(__file__))[0]
-
- msg = '''\
-Usage: salome [command] [options] [--config=file1,...,filen]
-
-Commands:
- start Launches SALOME virtual application [DEFAULT]
- shell Executes a script under SALOME application environment
- connect Connects a Python console to the active SALOME session
- killall Kill all SALOME running sessions
- info Display some information about SALOME
- help Show this message
- coffee Yes! SALOME can also make coffee!!"\
-
-'''
-
- print msg
- #
-
def __parseArguments(self, args):
if len(args) == 0 or args[0].startswith("-"):
return None, args
if command is None:
if args and args[0] in ["-h","--help","help"]:
- self._usage()
+ usage()
sys.exit(0)
# try to default to "start" command
command = "_runAppli"
self._runAppli(["--version"])
#
+ def _usage(self, unused=[]):
+ usage()
+ #
+
def _makeCoffee(self, args=[]):
print " ("
print " ) ("
if err:
sys.stderr.write(err)
else:
- SalomeRunner()._usage()
+ usage()
#
KERNEL_CXXFLAGS=""
AC_ARG_WITH(kernel,
- [--with-kernel=DIR root directory path of KERNEL build or installation],
- [KERNEL_DIR="$withval"],
- [KERNEL_DIR=""])
+ [--with-kernel=DIR root directory path of KERNEL build or installation],
+ [KERNEL_DIR="$withval"],
+ [KERNEL_DIR=""])
if test "x${KERNEL_DIR}" = "x" ; then
AC_MSG_RESULT(for \${KERNEL_ROOT_DIR}: ${KERNEL_ROOT_DIR})
KERNEL_DIR=${KERNEL_ROOT_DIR}
else
# search Kernel binaries in PATH variable
- AC_PATH_PROG(TEMP,runSalome)
+ AC_PATH_PROG(TEMP,runSalome.py)
if test "x${TEMP}" != "x" ; then
- AC_MSG_RESULT(runSalome was found at : ${TEMP})
+ AC_MSG_RESULT(runSalome.py was found at : ${TEMP})
KERNEL_BIN_DIR=`dirname ${TEMP}`
KERNEL_DIR=`cd ${KERNEL_BIN_DIR}/../..; pwd`
fi
fi
fi
-if test -f ${KERNEL_DIR}/bin/salome/runSalome ; then
+if test -f ${KERNEL_DIR}/bin/salome/runSalome.py ; then
AC_MSG_RESULT(Using Kernel module distribution in ${KERNEL_DIR})
Kernel_ok=yes
fi
AC_MSG_RESULT(for Kernel: $Kernel_ok)
-
+
])dnl
-
+
}
IncompatibleComponent::IncompatibleComponent(const IncompatibleComponent &ex):
- SALOME_Exception( ex )
+ SALOME_Exception( ex )
{
}
*/
//=============================================================================
-/*!
+/*!
* Constructor
*/
//=============================================================================
}
else _NS = ns;
//add try catch
- _NS->Change_Directory("/"); // mpv 250105: current directory may be not root
+ _NS->Change_Directory("/"); // mpv 250105: current directory may be not root
// (in SALOMEDS for an example)
// not enough: set a current directory in naming service is not thread safe
// if naming service instance is shared among several threads...
}
//=============================================================================
-/*!
+/*!
* Destructor
*/
//=============================================================================
// containerName doesn't contain "/" => Local container
params.container_name = CORBA::string_dup(stContainer);
}
- else
+ else
{
stContainer[rg]='\0';
params.container_name = CORBA::string_dup(stContainer+rg+1);
try
{
CORBA::Object_var obj = _NS->Resolve("/Kernel/ModulCatalog");
- SALOME_ModuleCatalog::ModuleCatalog_var Catalog =
+ SALOME_ModuleCatalog::ModuleCatalog_var Catalog =
SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj) ;
ASSERT(! CORBA::is_nil(Catalog));
- SALOME_ModuleCatalog::Acomponent_var compoInfo =
+ SALOME_ModuleCatalog::Acomponent_var compoInfo =
Catalog->GetComponent(componentName);
- if (CORBA::is_nil (compoInfo))
+ if (CORBA::is_nil (compoInfo))
{
MESSAGE("Catalog Error: Component not found in the catalog " << componentName);
return false;
*/
//=============================================================================
-void
+void
SALOME_LifeCycleCORBA::preSet(Engines::ResourceParameters& params)
{
params.name = "";
}
//=============================================================================
-/*!
+/*!
* \return a number of processors not 0, only for MPI containers
*/
//=============================================================================
{
// get each Container from NamingService => shutdown it
// (the order is inverse to the order of servers initialization)
-
+
SALOME::Session_var session = SALOME::Session::_nil();
CORBA::Long pid = 0;
CORBA::Object_var objS = _NS->Resolve("/Kernel/Session");
}
std::string hostname = Kernel_Utils::GetHostname();
-
+
// 1) ConnectionManager
try
{
{
// ignore and continue
}
-
+
//Wait some time so that launcher be completely shutdown
#ifndef WIN32
nanosleep(&ts_req,0);
name.length(1);
name[0].id = CORBA::string_dup(stdname.c_str());
try
- {
- if(!CORBA::is_nil(orb))
+ {
+ if(!CORBA::is_nil(orb))
theObj = orb->resolve_initial_references("NameService");
if (!CORBA::is_nil(theObj))
inc = CosNaming::NamingContext::_narrow(theObj);
catch(...)
{
}
- if(!CORBA::is_nil(inc))
+ if(!CORBA::is_nil(inc))
{
try
{
void SALOME_LifeCycleCORBA::killOmniNames()
{
std::string portNumber (::getenv ("NSPORT") );
- if ( !portNumber.empty() )
+ if ( !portNumber.empty() )
{
#ifdef WNT
#else
}
#endif
}
-
+
// NPAL 18309 (Kill Notifd)
- if ( !portNumber.empty() )
+ if ( !portNumber.empty() )
{
std::string cmd = ("from killSalomeWithPort import killNotifdAndClean; ");
cmd += std::string("killNotifdAndClean(") + portNumber + "); ";
MESSAGE(cmd);
system( cmd.c_str() );
}
+
+ // shutdown portmanager
+ if ( !portNumber.empty() )
+ {
+ std::string cmd = ("from PortManager import releasePort; ");
+ cmd += std::string("releasePort(") + portNumber + "); ";
+ cmd = std::string("python -c \"") + cmd +"\" > /dev/null 2> /dev/null";
+ MESSAGE(cmd);
+ system( cmd.c_str() );
+ }
}
//=============================================================================
*/
//=============================================================================
-Engines::EngineComponent_ptr
+Engines::EngineComponent_ptr
SALOME_LifeCycleCORBA::
-_LoadComponent(const Engines::ContainerParameters& params,
+_LoadComponent(const Engines::ContainerParameters& params,
const char *componentName,
int studyId)
{
char* reason;
bool isLoadable = cont->load_component_Library(componentName,reason);
- if (!isLoadable)
+ if (!isLoadable)
{
//std::cerr << reason << std::endl;
CORBA::string_free(reason);