Ticket #4317: LoaderOptionalSearchdirs.diff
| File LoaderOptionalSearchdirs.diff, 1.3 KB (added by ilias@…, 2 years ago) |
|---|
-
loader.py
31 31 32 32 __all__ = ['load_components'] 33 33 34 def load_components(env ):34 def load_components(env, search_dirs = None): 35 35 loaded_components = [] 36 36 plugins_dirs = [os.path.normcase(os.path.realpath(os.path.join(env.path, 37 37 'plugins'))), 38 38 default_dir('plugins')] 39 39 40 if search_dirs: 41 plugins_dirs = search_dirs 42 env.log.debug('load_components from alternate search_dirs') 43 40 44 # First look for Python source files in the plugins directories, which 41 45 # simply get imported, thereby registering them with the component manager 42 46 # if they define any components. … … 46 50 for plugin_file in plugin_files: 47 51 try: 48 52 plugin_name = os.path.basename(plugin_file[:-3]) 53 # do not process setup.py files 54 if plugin_name == 'setup': 55 continue 49 56 if plugin_name not in loaded_components: 50 57 env.log.debug('Loading file plugin %s from %s' % \ 51 58 (plugin_name, plugin_file))
