#!/usr/bin/env python import sys import salome import os import tempfile salome.salome_init() import salome_notebook notebook = salome_notebook.NoteBook() import salome_version #Prendre la version du SALOME #Salome version if salome_version.getVersions() >= [9, 4, 0]: #Si le dossier "WORK" n'existe pas, créez-le, sinon il passe. #pour la version 9.4.0 try: os.makedirs("WORK") except OSError: pass adresseAUX = os.getcwd() + '/WORK' else: #Salome 9.3.0 adresseAUX = os.getcwd() #Adresse du dossier adresse = adresseAUX #C'est possible de mettre autre dossier(Si le dossier WORK est protege), par exemple: adresse = "C:/Users/Daniel ~/Desktop" sys.path.insert(0, r'%s' % (adresse))
def GetVersions(): """returns the versions of the plugin as a list of integers e.g. [9,4,0] """ return salome_version.getVersions()
def GetVersionMinor(): """returns the minor version of Salome as int""" return salome_version.getVersions()[1]
def GetVersionPatch(): """returns the patch version of Salome as int""" return salome_version.getVersions()[2]
def GetVersionMajor(): """returns the major version of Salome as int""" return salome_version.getVersions()[0]