From: Anthony Geay Date: Wed, 7 Jun 2023 07:33:51 +0000 (+0200) Subject: [EDF27816] : management of proxy from/to Foreach X-Git-Tag: emc2p_1.4.0-rc1~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e6ba91b1799c2026f61f86bdeacf2419098a9e37;p=modules%2Fkernel.git [EDF27816] : management of proxy from/to Foreach --- 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):