| 230 | return cls.defaultLoader( "IECORE_OP_PATHS" ) |
| 231 | |
| 232 | def __updateClassFromSearchPath( self, searchPath, name ) : |
| 233 | |
| 234 | pattern = re.compile( r".*-(\d+).py$" ) |
| 235 | pruneDir = False |
| 236 | nameTail = os.path.split( name )[-1] |
| 237 | |
| 238 | # globbing for any extension rather than .py to avoid exploring shader |
| 239 | # directories without Python files. Function returns true on those cases. |
| 240 | gf = glob.glob( os.path.join( searchPath, name, nameTail + "*.*" ) ) |
| 241 | for f in gf : |
| 242 | |
| 243 | pruneDir = True |
| 244 | |
| 245 | m = re.match( pattern, f ) |
| 246 | try : |
| 247 | version = int( m.group( 1 ) ) |
| 248 | except : |
| 249 | continue |
| 250 | |
| 251 | c = self.__classes.setdefault( name, { "versions" : [], "imports" : {} } ) |
| 252 | |
| 253 | if not version in c["versions"]: |
| 254 | c["versions"].append( version ) |
| 255 | c["versions"].sort() |
| 256 | |
| 257 | return pruneDir |
| 258 | |
| 259 | def __findClass( self, name ) : |
| 260 | |