[MERGE] show versions of plugins in 'bzr plugins'

Aaron Bentley aaron.bentley at utoronto.ca
Wed Aug 29 02:43:45 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:

> + at deprecated_function(zero_ninetyone)
>  def all_plugins():
>      """Return a dictionary of the plugins."""
>      result = {}
> -    for name, plugin in plugins.__dict__.items():
> -        if isinstance(plugin, types.ModuleType):
> -            result[name] = plugin
> +    for name, plugin in plugins().items():
> +        result[name] = plugin.module
>      return result

I find this is a really nice way of doing that:

def all_plugins():
    return dict((n, p.module) for n, p in plugins().items())

bb:approve

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG1M9R0F+nu1YWqI0RAor+AKCDYwusdgoDa9U0UbWuA8R3WDugVwCdEkye
eFNbk6e7d9x3KwLH1ngELuI=
=IzjB
-----END PGP SIGNATURE-----



More information about the bazaar mailing list