comparison src/sat.tac @ 225:fd9b7834d98a

distutils installation script, draft
author Goffi <goffi@goffi.org>
date Wed, 05 Jan 2011 01:56:36 +0100
parents 86d249b6d9b7
children d8bb72f00eec
comparison
equal deleted inserted replaced
224:9c6ee3f9ab29 225:fd9b7834d98a
370 """Import all plugins found in plugins directory""" 370 """Import all plugins found in plugins directory"""
371 #TODO: manage dependencies 371 #TODO: manage dependencies
372 plug_lst = [os.path.splitext(plugin)[0] for plugin in map(os.path.basename,glob ("plugins/plugin*.py"))] 372 plug_lst = [os.path.splitext(plugin)[0] for plugin in map(os.path.basename,glob ("plugins/plugin*.py"))]
373 373
374 for plug in plug_lst: 374 for plug in plug_lst:
375 plug_path = 'plugins.'+plug 375 plug_path = 'sat.plugins.'+plug
376 __import__(plug_path) 376 __import__(plug_path)
377 mod = sys.modules[plug_path] 377 mod = sys.modules[plug_path]
378 plug_info = mod.PLUGIN_INFO 378 plug_info = mod.PLUGIN_INFO
379 info (_("importing plugin: %s"), plug_info['name']) 379 info (_("importing plugin: %s"), plug_info['name'])
380 self.plugins[plug_info['import_name']] = getattr(mod, plug_info['main'])(self) 380 self.plugins[plug_info['import_name']] = getattr(mod, plug_info['main'])(self)