from src.engines.core.base_engine import BaseRenderEngine


class AERender(BaseRenderEngine):

    supported_extensions = ['.aep']

    def version(self):
        version = None
        try:
            render_path = self.engine_path()
            if render_path:
                ver_out = subprocess.check_output([render_path, '-version'], timeout=SUBPROCESS_TIMEOUT)
                version = ver_out.decode('utf-8').split(" ")[-1].strip()
        except Exception as e:
            logger.error(f'Failed to get {self.name()} version: {e}')
        return version

    @classmethod
    def get_output_formats(cls):
        # todo: create implementation
        return []