Salome HOME
rename salome.py into run_salome.py
authorcrouzet <nicolas.crouzet@cea.fr>
Fri, 13 Dec 2019 13:42:22 +0000 (14:42 +0100)
committercrouzet <nicolas.crouzet@cea.fr>
Fri, 13 Dec 2019 13:42:22 +0000 (14:42 +0100)
bin/CMakeLists.txt
bin/run_salome.py [new file with mode: 0755]
bin/salome.py [deleted file]

index 3039ff3c5be5f66b7d60efd19469a3e20735207f..f4ab37a853e863aa7ce1aa705b5cab1b6b87b48d 100644 (file)
@@ -24,7 +24,7 @@
 # These files are executable scripts
 SET(SCRIPTS
   start_salome.py  # light python launcher
-  salome.py        # python launcher with context api relying on runSalome.py
+  run_salome.py        # python launcher with context api relying on runSalome.py
   )
 
 SALOME_INSTALL_SCRIPTS("${SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON})
diff --git a/bin/run_salome.py b/bin/run_salome.py
new file mode 100755 (executable)
index 0000000..8174d47
--- /dev/null
@@ -0,0 +1,75 @@
+#! /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
+
+# Preliminary work to initialize path to SALOME Python modules
+def __initialize():
+  # 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!")
+
+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
+  try:
+    from salomeContext import SalomeContext, SalomeContextException
+    context = SalomeContext(None)
+
+    # Logger level error
+    context.getLogger().setLevel(40)
+
+    if len(args) >1 and args[0]=='doc':
+        _showDoc(args[1:])
+        return
+
+    # Start SALOME, parsing command line arguments
+    out, err, status = context.runSalome(args)
+    sys.exit(status)
+
+  except SalomeContextException as e:
+    import logging
+    logging.getLogger("salome").error(e)
+    sys.exit(1)
+
+if __name__ == "__main__":
+  args = sys.argv[1:]
+  main(args)
+#
diff --git a/bin/salome.py b/bin/salome.py
deleted file mode 100755 (executable)
index 8174d47..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#! /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
-
-# Preliminary work to initialize path to SALOME Python modules
-def __initialize():
-  # 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!")
-
-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
-  try:
-    from salomeContext import SalomeContext, SalomeContextException
-    context = SalomeContext(None)
-
-    # Logger level error
-    context.getLogger().setLevel(40)
-
-    if len(args) >1 and args[0]=='doc':
-        _showDoc(args[1:])
-        return
-
-    # Start SALOME, parsing command line arguments
-    out, err, status = context.runSalome(args)
-    sys.exit(status)
-
-  except SalomeContextException as e:
-    import logging
-    logging.getLogger("salome").error(e)
-    sys.exit(1)
-
-if __name__ == "__main__":
-  args = sys.argv[1:]
-  main(args)
-#