MCPcopy Create free account
hub / github.com/ImageEngine/cortex / doOperation

Method doOperation

python/IECore/ClassLsOp.py:93–116  ·  view source on GitHub ↗
( self, operands )

Source from the content-addressed store, hash-verified

91 )
92
93 def doOperation( self, operands ) :
94
95 t = operands["type"].value
96 if t=="op" :
97 loader = IECore.ClassLoader.defaultOpLoader()
98 else :
99 if operands["searchPath"].value and operands["searchPathEnvVar"].value :
100 raise RuntimeError( "Cannot specify both searchPath and searchPathEnvVar." )
101 if not operands["searchPath"].value and not operands["searchPathEnvVar"].value :
102 raise RuntimeError( "Must specify either searchPath or searchPathEnvVar." )
103
104 if operands["searchPath"].value :
105 sp = IECore.SearchPath( operands["searchPath"].value )
106 else :
107 sp = IECore.SearchPath( os.path.expandvars( os.environ[operands["searchPathEnvVar"].value] ) )
108
109 loader = IECore.ClassLoader( sp )
110
111 classes = loader.classNames( operands["match"].value )
112
113 if operands["resultType"].value == "string" :
114 return IECore.StringData( "\n".join( classes ) )
115 else :
116 return IECore.StringVectorData( classes )
117
118IECore.registerRunTimeTyped( ClassLsOp )

Callers

nothing calls this directly

Calls 4

classNamesMethod · 0.95
defaultOpLoaderMethod · 0.80
SearchPathMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected