Salome HOME
Rename table to board for jobs publishing
[tools/sat.git] / data / env_scripts / distene_license.py
1 #!/usr/bin/env python
2 #-*- coding:utf-8 -*-
3
4 import os.path
5
6 def load_env(env):
7     license_file = '/data/tmpsalome/salome/prerequis/install/LICENSE/dlim8.var.sh'
8     if os.path.exists(license_file):
9         env.add_line(1)
10         env.add_comment("Set DISTENE License")
11         env.set('DISTENE_LICENSE_FILE', 'Use global envvar: DLIM8VAR')
12         env.set('DISTENE_LICENCE_FILE_FOR_MGCLEANER', license_file)
13         env.set('DISTENE_LICENCE_FILE_FOR_YAMS', license_file)
14
15         if os.access(license_file, os.R_OK):
16             lines = open(license_file, "r").readlines()
17             for line in lines:
18                 if line[:8] == "DLIM8VAR":
19                     # line is: DLIM8VAR="<key>"\n
20                     key = line.strip().split('=')[1]
21                     key = key.strip().strip('"')
22                     env.set("DLIM8VAR", key)
23                     break