if root_dir and os.path.exists( version_file ):
filename = version_file
if filename:
- str = open( filename, "r" ).readline() # str = "THIS IS SALOME - SALOMEGUI VERSION: 3.0.0"
- match = re.search( r':\s+([a-zA-Z0-9.]+)\s*$', str )
+ with open(filename, "r") as f:
+ v = f.readline() # v = "THIS IS SALOME - SALOMEGUI VERSION: 3.0.0"
+ match = re.search( r':\s+([a-zA-Z0-9.]+)\s*$', v )
if match :
return match.group( 1 )
except:
# Module : SALOME
# $Header$
#
-import sys,traceback,string
+import sys,traceback
import linecache
import pickle
import Engines__POA
self.nodeName=nodeName
self.code=code
self.my_container=my_container._container
- linecache.cache[nodeName]=0,None,string.split(code,'\n'),nodeName
+ linecache.cache[nodeName]=0,None,code.split('\n'),nodeName
ccode=compile(code,nodeName,'exec')
self.context={}
self.context["my_container"] = self.my_container
self.nodeName=nodeName
self.code=code
self.my_container=my_container._container
- linecache.cache[nodeName]=0,None,string.split(code,'\n'),nodeName
+ linecache.cache[nodeName]=0,None,code.split('\n'),nodeName
self.ccode=compile(code,nodeName,'exec')
self.context={}
self.context["my_container"] = self.my_container