+# salome doc only works for virtual applications. Therefore we overwrite it with this function
+def _showDoc(modules):
+ for module in modules:
+ modulePath = os.getenv(module+"_ROOT_DIR")
+ if modulePath != None:
+ baseDir = os.path.join(modulePath, "share", "doc", "salome")
+ docfile = os.path.join(baseDir, "gui", module.upper(), "index.html")
+ if not os.path.isfile(docfile):
+ docfile = os.path.join(baseDir, "tui", module.upper(), "index.html")
+ if not os.path.isfile(docfile):
+ docfile = os.path.join(baseDir, "dev", module.upper(), "index.html")
+ if os.path.isfile(docfile):
+ out, err = subprocess.Popen(["xdg-open", docfile]).communicate()
+ else:
+ print ("Online documentation is not accessible for module:", module)
+ else:
+ print (module+"_ROOT_DIR not found!")
+
+def main(args):
+ # Identify application path then locate configuration files
+ __initialize()
+
+ if args == ['--help']:
+ from salomeContext import usage
+ usage()
+ sys.exit(0)
+
+
+ # Create a SalomeContext which parses configFileNames to initialize environment
+ try:
+ from salomeContext import SalomeContext, SalomeContextException
+ context = SalomeContext(None)
+
+ # Here set specific variables, if needed
+ # context.addToPath('mypath')
+ # context.addToLdLibraryPath('myldlibrarypath')
+ # context.addToPythonPath('mypythonpath')
+ # context.setVariable('myvarname', 'value')
+
+ # Logger level error
+ context.getLogger().setLevel(40)
+"""
+
+launcher_header3="""\
+#! /usr/bin/env python3
+
+################################################################
+# WARNING: this file is automatically generated by SalomeTools #
+# WARNING: and so could be overwritten at any time. #
+################################################################
+
+import os
+import sys
+import subprocess
+
+
+# Add the pwdPath to able to run the launcher after unpacking a package
+# Used only in case of a salomeTools package
+out_dir_Path=os.path.dirname(os.path.realpath(__file__))
+
+# Preliminary work to initialize path to SALOME Python modules
+def __initialize():
+
+ sys.path[:0] = [ r'BIN_KERNEL_INSTALL_DIR' ]
+
+ # define folder to store omniorb config (initially in virtual application folder)
+ try:
+ from salomeContextUtils import setOmniOrbUserPath
+ setOmniOrbUserPath()
+ except Exception as e:
+ print(e)
+ sys.exit(1)
+# End of preliminary work
+
+# salome doc only works for virtual applications. Therefore we overwrite it with this function
+def _showDoc(modules):
+ for module in modules:
+ modulePath = os.getenv(module+"_ROOT_DIR")
+ if modulePath != None:
+ baseDir = os.path.join(modulePath, "share", "doc", "salome")
+ docfile = os.path.join(baseDir, "gui", module.upper(), "index.html")
+ if not os.path.isfile(docfile):
+ docfile = os.path.join(baseDir, "tui", module.upper(), "index.html")
+ if not os.path.isfile(docfile):
+ docfile = os.path.join(baseDir, "dev", module.upper(), "index.html")
+ if os.path.isfile(docfile):
+ out, err = subprocess.Popen(["xdg-open", docfile]).communicate()
+ else:
+ print("Online documentation is not accessible for module:", module)
+ else:
+ print(module+"_ROOT_DIR not found!")
+