[MERGE] Re: windows-only problem with launchpad plugin
Aaron Bentley
aaron.bentley at utoronto.ca
Tue Jul 10 21:11:00 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Arbash Meinel wrote:
> Just forwarding it back to the list with [MERGE] so that BB can pick it up. (I
> wanted to vote it in :)
@@ -194,29 +194,33 @@
"""Load all the plugins in a zip."""
valid_suffixes = ('.py', '.pyc', '.pyo') # only python
modules/packages
# is allowed
- - if '.zip' not in zip_name:
+
+ try:
+ index = zip_name.rindex('.zip')
+ except ValueError:
return
^^^ I think the assignment of prefix should be moved up here. It's not
obvious that we use index later on.
- - plugin = ziobj.load_module(plugin_name)
- - setattr(plugins, plugin_name, plugin)
+ exec "import bzrlib.plugins.%s" % plugin_name in {}
Why do we want to use exec "import" here?
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGk+fU0F+nu1YWqI0RAiMAAJ90+s5324/+rUrjB+/VvL8VqboTIQCdEUZ2
BRP3PISKLrYoHCA6CxupOm4=
=wKMZ
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list