From e6ba91b1799c2026f61f86bdeacf2419098a9e37 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 7 Jun 2023 09:33:51 +0200 Subject: [PATCH] [EDF27816] : management of proxy from/to Foreach --- src/Container/SALOME_PyNode.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Container/SALOME_PyNode.py b/src/Container/SALOME_PyNode.py index 0238ad9f1..f02c2d0df 100644 --- a/src/Container/SALOME_PyNode.py +++ b/src/Container/SALOME_PyNode.py @@ -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): -- 2.39.2