Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rhoban/onshape-to-robot
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregwar committed Aug 31, 2023
2 parents 2e59481 + 15ada6c commit cd7dadf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions onshape_to_robot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
import sys
import os
import commentjson as json
from colorama import Fore, Back, Style
import subprocess
from colorama import Fore, Back, Style, just_fix_windows_console

just_fix_windows_console()
config = {}

# Loading configuration & parameters
Expand Down Expand Up @@ -122,13 +124,18 @@ def configGet(name, default=None, hasDefault=False, valuesList=None):
# Checking that OpenSCAD is present
if config['useScads']:
print(Style.BRIGHT + '* Checking OpenSCAD presence...' + Style.RESET_ALL)
if os.system('openscad -v 2> /dev/null') != 0:
try:
subprocess.run(["openscad", "-v"])
except FileNotFoundError:
print(
Fore.RED + "Can't run openscad -v, disabling OpenSCAD support" + Style.RESET_ALL)
print(Fore.BLUE + "TIP: consider installing openscad:" + Style.RESET_ALL)
print(Fore.BLUE + "Linux:" + Style.RESET_ALL)
print(Fore.BLUE + "sudo add-apt-repository ppa:openscad/releases" + Style.RESET_ALL)
print(Fore.BLUE + "sudo apt-get update" + Style.RESET_ALL)
print(Fore.BLUE + "sudo apt-get install openscad" + Style.RESET_ALL)
print(Fore.BLUE + "Windows:" + Style.RESET_ALL)
print(Fore.BLUE + "go to: https://openscad.org/downloads.html " + Style.RESET_ALL)
config['useScads'] = False

# Checking that MeshLab is present
Expand Down

0 comments on commit cd7dadf

Please sign in to comment.