def _loadInstrumentPlugins(self): from InstrumentLoader import InstrumentLoader searchDirs = [ u'~/Library/Application Support/WILD Instruments', u'~/.wild/instruments', u'/Library/Application Support/WILD Instruments', u'/usr/local/share/wild/instruments', u'/usr/share/wild/instruments', u'/Network/Library/Application Support/WILD Instruments', ] searchDirs = [ os.path.expanduser(searchDir) for searchDir in searchDirs ] for searchDir in searchDirs: print "Searching in searchDir", searchDir if os.path.exists(searchDir): pluginPaths = [ os.path.join(searchDir, f) for f in os.listdir(searchDir) if f.endswith(u'.instrument') ] for pluginPath in pluginPaths: try: InstrumentLoader.loadInstrumentFromBundlePath(pluginPath) except Exception, e: # FIXME: Should probably alert user pluginName = os.path.basename(pluginPath) print u"Could not load plugin: %s: %s: %s" % (pluginName, e.__class__.__name__, e)