Rename get_formats to get_output_formats for engines

This commit is contained in:
Brett Williams
2023-05-23 20:42:26 -05:00
parent 29e03eac87
commit 6c3d0e8f6e
4 changed files with 6 additions and 13 deletions

View File

@@ -34,7 +34,7 @@ class AERender(BaseRenderEngine):
return version
@classmethod
def get_formats(cls):
def get_output_formats(cls):
# todo: create implementation
return []

View File

@@ -22,7 +22,7 @@ class Blender(BaseRenderEngine):
return version
@classmethod
def get_formats(cls):
def get_output_formats(cls):
format_string = cls.get_help().split('Format Options')[-1].split('Animation Playback Options')[0]
formats = re.findall(r"'([A-Z_0-9]+)'", format_string)
return formats
@@ -218,7 +218,7 @@ if __name__ == '__main__':
print(Blender.full_report())
# x = pack_blender_files('/Users/brett/Blender Files/temple_animatic.blend')
x = Blender.pack_project_file('/Users/brettwilliams/Downloads/barbershop_interior.blend')
# print(x)
# logging.basicConfig(format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S', level=logging.DEBUG)

View File

@@ -25,19 +25,12 @@ class FFMPEG(BaseRenderEngine):
return encoders
@classmethod
def get_formats(cls):
def get_output_formats(cls):
formats_raw = subprocess.check_output([cls.renderer_path(), '-formats'], stderr=subprocess.DEVNULL).decode('utf-8')
pattern = '(?P<type>[DE]{1,2})\s+(?P<name>\S{2,})\s+(?P<description>.*)'
formats = [m.groupdict() for m in re.finditer(pattern, formats_raw)]
return formats
@classmethod
def full_report(cls):
return {'version': cls.version(),
'help_text': cls.get_help(),
'encoders': cls.get_encoders(),
'formats': cls.get_formats()}
class FFMPEGRenderWorker(BaseRenderWorker):

View File

@@ -253,8 +253,8 @@ class BaseRenderEngine(object):
return help_doc
@classmethod
def get_formats(cls):
raise NotImplementedError("get_formats not implemented")
def get_output_formats(cls):
raise NotImplementedError(f"get_output_formats not implemented for {cls.__name__}")
class RenderWorkerFactory: