additional_env['APPLI'] = filepath
+
# get KERNEL bin installation path
# (in order for the launcher to get python salomeContext API)
kernel_cfg = src.product.get_product_config(config, "KERNEL")
else:
bin_kernel_install_dir = os.path.join(kernel_root_dir,"bin","salome")
+ # check if the application contains an application module
+ l_product_info = src.product.get_products_infos(config.APPLICATION.products.keys(),
+ config)
+ salome_application_name="Not defined"
+ for prod_name, prod_info in l_product_info:
+ # look for a salome application
+ if src.get_property_in_product_cfg(prod_info, "is_salome_application") == "yes":
+ salome_application_name=prod_info.install_dir
+ continue
+
+ # if the application contains an application module, we set ABSOLUTE_APPLI_PATH to it.
+ # if not we set it to KERNEL_INSTALL_DIR, which is sufficient, except for salome test
+ if salome_application_name == "Not defined":
+ app_root_dir=kernel_root_dir
+ else:
+ app_root_dir=salome_application_name
+
# Get the launcher template
withProfile = src.fileEnviron.withProfile\
.replace("BIN_KERNEL_INSTALL_DIR", bin_kernel_install_dir)\
- .replace("KERNEL_INSTALL_DIR", kernel_root_dir)
+ .replace("KERNEL_INSTALL_DIR", app_root_dir)
before, after = withProfile.split(
"# here your local standalone environment\n")
else:
bin_kernel_install_dir = os.path.join(kernel_root_dir,"bin","salome")
+ # check if the application contains an application module
+ l_product_info = src.product.get_products_infos(config.APPLICATION.products.keys(),
+ config)
+ salome_application_name="Not defined"
+ for prod_name, prod_info in l_product_info:
+ # look for a salome application
+ if src.get_property_in_product_cfg(prod_info, "is_salome_application") == "yes":
+ salome_application_name=prod_info.name
+ continue
+ # if the application contains an application module, we set ABSOLUTE_APPLI_PATH to it
+ # if not we set it to KERNEL_INSTALL_DIR, which is sufficient, except for salome test
+ if salome_application_name == "Not defined":
+ app_root_dir=kernel_root_dir
+ else:
+ app_root_dir=os.path.join(binaries_dir_name, salome_application_name)
+
# Get the launcher template and do substitutions
withProfile = src.fileEnviron.withProfile
withProfile = withProfile.replace(
"ABSOLUTE_APPLI_PATH'] = 'KERNEL_INSTALL_DIR'",
- "ABSOLUTE_APPLI_PATH'] = out_dir_Path + '" + config.VARS.sep + kernel_root_dir + "'")
+ "ABSOLUTE_APPLI_PATH'] = out_dir_Path + '" + config.VARS.sep + app_root_dir + "'")
withProfile = withProfile.replace(
" 'BIN_KERNEL_INSTALL_DIR'",
" out_dir_Path + '" + config.VARS.sep + bin_kernel_install_dir + "'")
import os
import sys
+import subprocess
# Add the pwdPath to able to run the launcher after unpacking a package
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!"
+
def main(args):
# Identify application path then locate configuration files
__initialize()
context.setVariable(r"PRODUCT_ROOT_DIR", out_dir_Path, overwrite=True)
# here your local standalone environment
+ if len(args) >1 and args[0]=='doc':
+ _showDoc(args[1:])
+ return
+
# Start SALOME, parsing command line arguments
context.runSalome(args)
#print 'Thank you for using SALOME!'