Salome HOME
Deal with ref count server side.
[modules/kernel.git] / bin / runConsole.py
index 72d73c77b4b0eb6a7875a7e89284f1af15a0fb4c..fdaba6ce5abbf6e4d96288d9f9d2471708004f11 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -7,7 +7,7 @@
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-def __prompt(vars = None, commands=[], message = "Connecting to SALOME"):
-  if vars is None:
-    vars = globals()
+def __prompt(environment = None, commands=[], message = "Connecting to SALOME"):
+  if environment is None:
+    environment = globals().copy()
+    environment.update(locals())
+
   import code
   import rlcompleter
   import readline
   readline.parse_and_bind("tab: complete")
   # calling this with globals ensures we can see the environment
   print message
-  shell = code.InteractiveConsole(vars)
+  shell = code.InteractiveConsole(environment)
   for cmd in commands:
     shell.push(cmd)
   return shell.interact