]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
desactivate foreground() for
authoradam <adam>
Thu, 7 Apr 2011 13:10:40 +0000 (13:10 +0000)
committeradam <adam>
Thu, 7 Apr 2011 13:10:40 +0000 (13:10 +0000)
 o runSalome --pinter option
 o python -i runSalome.py use case

bin/runSalome.py

index 3bcd64c36aa0b76e9bd3a5a339abdd194f37dd31..df2f47ee52708e942fcd43b8a304f162a02c8ea2 100755 (executable)
@@ -1010,7 +1010,22 @@ if __name__ == "__main__":
     # --
     test = args['gui'] and args['session_gui']
     test = test or args['wake_up_session']
+    # --
+    # The next test covers the --pinter option or var PYTHONINSPECT setted
+    # --
+    test = test and not os.environ.get('PYTHONINSPECT')
+    # --
+    # The next test covers the python -i $KERNEL_ROOT_DIR/bin/salome/runSalome.py case
+    # --
+    try:
+        from ctypes import POINTER, c_int, cast, pythonapi
+        iflag_ptr = cast(pythonapi.Py_InteractiveFlag, POINTER(c_int))
+        test = test and not iflag_ptr.contents.value
+    except:
+        pass
+    # --
     test = test and os.getenv("SALOME_TEST_MODE", "0") != "1"
+    # --
     if test:
         foreGround(clt, args)
         pass