# values passed as arguments, NOT read from XML config file, but set from within this script
appname_nam = "appname"
port_nam = "port"
+useport_nam = "useport"
salomecfgname = "salome"
salomeappname = "SalomeApp"
script_nam = "pyscript"
dest="server_launch_mode",
help=help_str)
+ # use port
+ help_str = "Preferable port SALOME to be started on. "
+ help_str += "If specified port is not busy, SALOME session will start on it; "
+ help_str += "otherwise, any available port will be searched and used."
+ o_port = optparse.Option("--port",
+ metavar="<port>",
+ type="int",
+ action="store",
+ dest="use_port",
+ help=help_str)
+
# All options
opt_list = [o_t,o_g, # GUI/Terminal
o_d,o_o, # Desktop
o_foreground,
o_wake_up,
o_slm, # Server launch mode
+ o_port, # Use port
]
#std_options = ["gui", "desktop", "log_file", "py_scripts", "resources",
# Server launch command
if cmd_opts.server_launch_mode is not None:
- args["server_launch_mode"] = cmd_opts.server_launch_mode
+ args["server_launch_mode"] = cmd_opts.server_launch_mode
+
+ # Server launch command
+ if cmd_opts.use_port is not None:
+ min_port = 2810
+ max_port = min_port + 100
+ if cmd_opts.use_port not in xrange(min_port, max_port+1):
+ print "Error: port number should be in range [%d, %d])" % (min_port, max_port)
+ sys.exit(1)
+ args[useport_nam] = cmd_opts.use_port
# return arguments
os.environ[config_var] = separator.join(dirs)
pass
if test:
from searchFreePort import searchFreePort
- searchFreePort(args, save_config)
+ searchFreePort(args, save_config, args.get('useport'))
pass
# --
#setenv.main()
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-def searchFreePort(args={}, save_config=1):
+def searchFreePort(args={}, save_config=1, use_port=None):
"""
Search free port for SALOME session.
Returns first found free port number.
"""
import sys, os, re, shutil
- print "Searching for a free port for naming service:",
# :NOTE: Under windows:
# netstat options -l and -t are unavailable
pass
return False
#
- NSPORT=2810
- limit=NSPORT+100
- #
- while 1:
- if not portIsUsed(NSPORT, ports):
- print "%s - OK"%(NSPORT)
+ def setup_config(nsport):
#
from salome_utils import generateFileName, getHostName
hostname = getHostName()
appli = os.getenv("APPLI")
kwargs={}
if appli is not None:
- home = os.path.join(os.path.realpath(home), appli,"USERS")
+ home = os.path.join(os.path.realpath(home), appli, "USERS")
kwargs["with_username"]=True
#
from ORBConfigFile import writeORBConfigFile
- omniorb_config, giopsize = writeORBConfigFile(home, hostname, NSPORT, kwargs)
-
+ omniorb_config, giopsize = writeORBConfigFile(home, hostname, nsport, kwargs)
args['port'] = os.environ['NSPORT']
#
if save_config:
except:
pass
#
+
+ if use_port:
+ print "Check if port can be used: %d" % use_port,
+ if not portIsUsed(use_port, ports):
+ print "- OK"
+ setup_config(use_port)
+ return
+ else:
+ print "- KO: port is busy"
+ pass
+ #
+
+ print "Searching for a free port for naming service:",
+ #
+
+ NSPORT=2810
+ limit=NSPORT+100
+ #
+
+ while 1:
+ if not portIsUsed(NSPORT, ports):
+ print "%s - OK"%(NSPORT)
+ setup_config(NSPORT)
break
print "%s"%(NSPORT),
if NSPORT == limit:
raise RuntimeError, msg
NSPORT=NSPORT+1
pass
+ #
+
return
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>$title</title>
<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="$relpath^jquery.js"></script>
+<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
\section S3_main Application Integrator
- Applications integrators are in charge of configuration and installation of
- specific %SALOME applications over a local network. Application Integrators
- built %SALOME modules binaries from sources tarballs.
+Applications integrators are in charge of configuration and installation of
+specific %SALOME applications over a local network. Application Integrators
+built %SALOME modules binaries from sources tarballs.
-# <b>How to install %SALOME</b>\n
See \subpage INSTALL for general information on required configuration and
\section S4_main Module maintainer
- Module maintainers are in charge of the development and debug of the %SALOME
- modules. Each %SALOME module is stored in a CVS base. CVS bases are organised
- in separate branches for developments and debug. All official or development
- releases are identified by a CVS tag.
+Module maintainers are in charge of the development and debug of the %SALOME
+modules. Each %SALOME module is stored in a CVS base. CVS bases are organised
+in separate branches for developments and debug. All official or development
+releases are identified by a CVS tag.
-# <b>Source code structuration and Unit Tests</b>\n
See \subpage UnitTests for general information on code directories structure,
\section S5_main SALOME programming model
- You will find in the next pages informations about
- specific points of %SALOME Kernel :
+You will find in the next pages informations about
+specific points of %SALOME Kernel :
- - \subpage kernel_salome
- - \subpage dsc_page : DSC documentation page.
- - \subpage salome_file_page : Salome_file documentation page.
- - <a class="el" href="../../tui/KERNEL/docutils/index.html" target="_new">
- Documentation of the KERNEL python package</a> : The package salome.kernel provides
- logging tools, high-level functions to handle items in Salome study, and other utilities.
+- \subpage kernel_salome
+- \subpage dsc_page : DSC documentation page.
+- \subpage salome_file_page : Salome_file documentation page.
+- <a class="el" href="../../tui/KERNEL/docutils/index.html" target="_new">
+ Documentation of the KERNEL python package</a> : The package salome.kernel provides
+ logging tools, high-level functions to handle items in Salome study, and other utilities.
*/
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>$title</title>
<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="$relpath^jquery.js"></script>
+<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax