Added code to help tools like iBoM support KiCad nightly

This commit is contained in:
Salvador E. Tropea 2021-12-27 15:22:05 -03:00
parent 54332a8630
commit 1dda02efab
1 changed files with 7 additions and 1 deletions

View File

@ -217,7 +217,13 @@ def detect_kicad():
nightly = False
if os.environ.get('KIAUS_USE_NIGHTLY'): # pragma: no cover (Ki6)
# Path to the Python module
sys_path.insert(0, '/usr/lib/kicad-nightly/lib/python3/dist-packages')
pcbnew_path = '/usr/lib/kicad-nightly/lib/python3/dist-packages'
sys_path.insert(0, pcbnew_path)
# This helps other tools like iBoM to pick-up the right pcbnew module
if 'PYTHONPATH' in os.environ:
os.environ['PYTHONPATH'] += ':'+pcbnew_path
else:
os.environ['PYTHONPATH'] = pcbnew_path
nightly = True
try:
import pcbnew