comparison MoinMoin/config/multiconfig.py @ 4031:68951e8e069d

plugin module loader: fix _plugin_modules list for the case when module was already loaded before
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 24 Aug 2008 17:53:55 +0200
parents f85cd27073a9
children 4a994a297ba3
comparison
equal deleted inserted replaced
4029:3d5c4ebe8f34 4031:68951e8e069d
589 fp, path, info = imp.find_module(pname, [parent_dir]) 589 fp, path, info = imp.find_module(pname, [parent_dir])
590 try: 590 try:
591 # Load the module and set in sys.modules 591 # Load the module and set in sys.modules
592 module = imp.load_module(modname, fp, path, info) 592 module = imp.load_module(modname, fp, path, info)
593 setattr(sys.modules[self.siteid], 'csum', module) 593 setattr(sys.modules[self.siteid], 'csum', module)
594 self._plugin_modules.append(modname)
595 finally: 594 finally:
596 # Make sure fp is closed properly 595 # Make sure fp is closed properly
597 if fp: 596 if fp:
598 fp.close() 597 fp.close()
598 if modname not in self._plugin_modules:
599 self._plugin_modules.append(modname)
599 finally: 600 finally:
600 imp.release_lock() 601 imp.release_lock()
601 except ImportError, err: 602 except ImportError, err:
602 msg = """ 603 msg = """
603 Could not import plugin package "%(path)s" because of ImportError: 604 Could not import plugin package "%(path)s" because of ImportError: