Pyinstaller support (#93)

* Add main.spec

* Fix issue where fetching supported extensions would crash with no default installation
This commit is contained in:
2024-08-10 14:58:41 -05:00
committed by GitHub
parent 51a5a63944
commit 3b33649f2d
10 changed files with 89 additions and 41 deletions

View File

@@ -9,12 +9,11 @@ SUBPROCESS_TIMEOUT = 5
class BaseRenderEngine(object):
install_paths = []
supported_extensions = []
def __init__(self, custom_path=None):
self.custom_renderer_path = custom_path
if not self.renderer_path() or not os.path.exists(self.renderer_path()):
raise FileNotFoundError(f"Cannot find path to renderer for {self.name()} instance")
raise FileNotFoundError(f"Cannot find path to renderer for {self.name()} instance: {self.renderer_path()}")
if not os.access(self.renderer_path(), os.X_OK):
logger.warning(f"Path is not executable. Setting permissions to 755 for {self.renderer_path()}")
@@ -43,6 +42,9 @@ class BaseRenderEngine(object):
def version(self):
raise NotImplementedError("version not implemented")
def supported_extensions(self):
return []
@staticmethod
def downloader(): # override when subclassing if using a downloader class
return None
@@ -51,7 +53,8 @@ class BaseRenderEngine(object):
def worker_class(): # override when subclassing to link worker class
raise NotImplementedError("Worker class not implemented")
def ui_options(self): # override to return options for ui
@staticmethod
def ui_options(system_info): # override to return options for ui
return {}
def get_help(self): # override if renderer uses different help flag