problem with hack using multiple inheritance for plugins

massimo s. devicerandom at gmail.com
Thu Jun 28 08:30:34 EDT 2007


On 28 Giu, 13:45, Bruno Desthuilliers <bruno.
42.desthuilli... at wtf.websiteburo.oops.com> wrote:
> <side-note>
> wrt/ this snippet:
>
>     for plugin_name in self.config['plugins']:
>          try:
>              plugin=__import__(plugin_name)
>              try:
>                  print type(self)
>                  eval('plugin.'+plugin_name+'Commands._plug_init(self)')
>              except AttributeError:
>                  pass
>          except ImportError:
>              pass
>
> You may want to try this instead:
>
>     for plugin_name in self.config['plugins']:
>          try:
>              plugin=__import__(plugin_name)
>          except ImportError:
>              # eventually do something like logging the error ?
>              continue
>          try:
>              cmdplug = getattr(plugin, plugin_name+'Commands')
>              cmdplug._plug_init(self)
>          except AttributeError:
>              # eventually do something like logging the error ?
>              continue

Tried, same error as before :(




More information about the Python-list mailing list