Example #1
0
#!/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))
Example #2
0
def GetVersions():
    """returns the versions of the plugin as a list of integers
    e.g. [9,4,0]
    """
    return salome_version.getVersions()
Example #3
0
def GetVersionMinor():
    """returns the minor version of Salome as int"""
    return salome_version.getVersions()[1]
Example #4
0
def GetVersionPatch():
    """returns the patch version of Salome as int"""
    return salome_version.getVersions()[2]
Example #5
0
def GetVersionMajor():
    """returns the major version of Salome as int"""
    return salome_version.getVersions()[0]