From b684e13e87956ccd77dfc7da27907f250dfdc62c Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Fri, 9 Sep 2022 23:50:00 -0400 Subject: [PATCH] for image generation locally only. --- main.py | 7 +++++-- requirements.txt | 4 +--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 5c721aef..958ffa51 100644 --- a/main.py +++ b/main.py @@ -74,20 +74,23 @@ class cl: print('INFO\t - {:s}Using git branch in main.py:{:s} {:s}'.format(cl.GRN,cl.END,currentGitBranch)) # End of optional block - +flag_gen_image = True try: from stl.mesh import Mesh except ImportError: + flag_gen_image = False print('\n\n{:s}{:s}ERROR\t - Unable to import Python module "stl", check to see if numpy-stl is installed.{:s}\n\n'.format(cl.FAIL,cl.BOLD,cl.END)) try: import vtkplotlib as vpl except ImportError: + flag_gen_image = False print('\n\n{:s}{:s}ERROR\t - Unable to import Python module "vtkplotlib", check to see if vtkplotlib is installed.{:s}\n\n'.format(cl.FAIL,cl.BOLD,cl.END)) try: from PIL import Image except ImportError: + flag_gen_image = False print('\n\n{:s}{:s}ERROR\t - Unable to import Python module "PIL", check to see if PIL is installed.{:s}\n\n'.format(cl.FAIL,cl.BOLD,cl.END)) @@ -146,7 +149,7 @@ def listfiles(path): def check_generate(file_path): name_file = './docs/'+file_path image_name = name_file.replace(".stl",".png") - if not os.path.exists(image_name): + if not os.path.exists(image_name) and flag_gen_image: print('INFO\t - {:s}Attempting to generate:{:s} {:s} -> {:s}'.format(cl.GRN,cl.END,name_file,image_name)) try: mesh = Mesh.from_file(name_file) diff --git a/requirements.txt b/requirements.txt index 42645337..b7fddd72 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,3 @@ +Jinja2==3.0.3 mkdocs-macros-plugin==0.7.0 GitPython==3.1.24 -numpy-stl==2.17.1 -vtkplotlib==2.0.0 -Pillow==9.0.1