# -*- 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
#--------------------------------------------------------------------------
+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")