On Thu, 22 Feb 2007 15:36:42 +0100, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Simple plugin system proposal: >> >> have a package (directory with __init__.py) called plugins where the >> actual plugins are modules in this directory. >> >> When the main script imports the plugins package, all plugin modules >> would be available as plugins.pluginA, plugins.pluginB , etc. >> >> A registry of available plugins would be available as a simple >> dir(plugins). >> >> code in the main script than wished to use a given plugin, would only >> have to look in the registry before calling any code from a given >> plugin. >> >> What is wrong/missing with this simple framework? > >Nothing wrong.
Are you sure? [EMAIL PROTECTED]:~$ mkdir someplugins [EMAIL PROTECTED]:~$ touch someplugins/__init__.py [EMAIL PROTECTED]:~$ touch someplugins/a.py [EMAIL PROTECTED]:~$ python Python 2.4.3 (#2, Oct 6 2006, 07:52:30) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import someplugins >>> dir(someplugins) ['__builtins__', '__doc__', '__file__', '__name__', '__path__'] >>> Hey, where's my plugin? This most trivial test would have demonstrated the problem with the proposed plugin system. But I suppose it was easier for Flavio to make someone else find the defect in his new system than to either test it himself or to look carefully at any of the existing systems. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list