Skip to content

Commit eeaf8bb

Browse files
committed
Merge pull request #480 from cchampet/fix_samDoFileFormats
sam do: catch loading errors when use option --file-formats
2 parents 8fab076 + 550bc86 commit eeaf8bb

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

applications/sam/sam_do.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,19 @@ def getListOfSupportedExtension(ofxhImageEffectNodeDescriptor):
171171

172172
supportedExtensions = {'r': [], 'w': []}
173173
for plugin in tuttle.core().getImageEffectPluginCache().getPlugins():
174-
plugin.loadAndDescribeActions()
175-
if plugin.supportsContext('OfxImageEffectContextReader'):
176-
pluginDescriptor = plugin.getDescriptorInContext('OfxImageEffectContextReader')
177-
if pluginDescriptor.getParamSetProps().hasProperty('TuttleOfxImageEffectPropSupportedExtensions'):
178-
supportedExtensions['r'].extend(getListOfSupportedExtension(pluginDescriptor))
179-
elif plugin.supportsContext('OfxImageEffectContextWriter'):
180-
pluginDescriptor = plugin.getDescriptorInContext('OfxImageEffectContextWriter')
181-
if pluginDescriptor.getParamSetProps().hasProperty('TuttleOfxImageEffectPropSupportedExtensions'):
182-
supportedExtensions['w'].extend(getListOfSupportedExtension(pluginDescriptor))
174+
try:
175+
plugin.loadAndDescribeActions()
176+
if plugin.supportsContext('OfxImageEffectContextReader'):
177+
pluginDescriptor = plugin.getDescriptorInContext('OfxImageEffectContextReader')
178+
if pluginDescriptor.getParamSetProps().hasProperty('TuttleOfxImageEffectPropSupportedExtensions'):
179+
supportedExtensions['r'].extend(getListOfSupportedExtension(pluginDescriptor))
180+
elif plugin.supportsContext('OfxImageEffectContextWriter'):
181+
pluginDescriptor = plugin.getDescriptorInContext('OfxImageEffectContextWriter')
182+
if pluginDescriptor.getParamSetProps().hasProperty('TuttleOfxImageEffectPropSupportedExtensions'):
183+
supportedExtensions['w'].extend(getListOfSupportedExtension(pluginDescriptor))
184+
except Exception as e:
185+
self.logger.warning('Cannot load and describe plugin "' + plugin.getIdentifier() + '".')
186+
self.logger.debug(e)
183187
for key, extensions in supportedExtensions.items():
184188
if key == 'r':
185189
self._displayTitle('SUPPORTED INPUT FILE FORMATS')

0 commit comments

Comments
 (0)