X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FKERNEL_PY%2Fsalome_study.py;h=02dc26a432681a93db6e7e568accec13bc71ade8;hb=24b662cbbe2b2f731337b09565b6a47ba19d8cb4;hp=5de40bc3a3d4e10b8b2b8bf3c286313b54c3f5cb;hpb=288dc1c84630e521220d796b7c88c518f34856d5;p=modules%2Fkernel.git diff --git a/src/KERNEL_PY/salome_study.py b/src/KERNEL_PY/salome_study.py index 5de40bc3a..02dc26a43 100644 --- a/src/KERNEL_PY/salome_study.py +++ b/src/KERNEL_PY/salome_study.py @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2013 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 @@ -227,6 +227,27 @@ def CheckCopyPaste(theSO, theInfo ,theComponentPaste): #-------------------------------------------------------------------------- +def GetComponentVersion(theComponent, all_versions = False): + # returns the document list tree (as list) + props = myStudy.GetProperties() + stored_components = props.GetStoredComponents() + version = "no component data" # vsr: better raise an exception in this case? + if theComponent in stored_components: + if all_versions: + version = props.GetComponentVersions(theComponent) + for i in range(len(version)): + if not version[i]: version[i] = "unknown" + pass + pass + else: + version = props.GetComponentVersion(theComponent) + if not version: version = "unknown" + pass + pass + return version + + #-------------------------------------------------------------------------- + def FindFileInDataDir(filename): import os datadir = os.getenv("DATA_DIR")