Salome HOME
[EDF27816] : management of proxy from/to Foreach
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 7 Jun 2023 07:33:51 +0000 (09:33 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 7 Jun 2023 07:33:51 +0000 (09:33 +0200)
src/Container/SALOME_PyNode.py

index 0238ad9f19b65735fade4ed0829205f35d185ed6..f02c2d0df95777e5449772387afc8f24f3b8bfa0 100644 (file)
@@ -132,7 +132,7 @@ def GetBigObjectDirectory():
   import os
   if SALOME_FILE_BIG_OBJ_DIR not in os.environ:
     raise RuntimeError("An object of size higher than limit detected and no directory specified to dump it in file !")
-  return os.path.expandvars( os.path.expandvars( os.environ[SALOME_FILE_BIG_OBJ_DIR] ) )
+  return os.path.expanduser( os.path.expandvars( os.environ[SALOME_FILE_BIG_OBJ_DIR] ) )
 
 def GetBigObjectFileName():
   """
@@ -182,6 +182,19 @@ class BigObjectOnDiskBase:
     import pickle
     with open(self._filename,"rb") as f:
       return pickle.load(f)
+
+  def __float__(self):
+    return float( self.get() )
+    
+  def __int__(self):
+    return int( self.get() )
+    
+  def __str__(self):
+    obj = self.get()
+    if isinstance(obj,str):
+        return obj
+    else:
+        raise RuntimeError("Not a string")
       
 class BigObjectOnDisk(BigObjectOnDiskBase):
   def __init__(self, fileName, objSerialized):