diff --git a/README.rst b/README.rst index df86c81..bb4a8e7 100644 --- a/README.rst +++ b/README.rst @@ -70,6 +70,18 @@ And an example of one such listener would be: # Do something very useful! =) +New in version 0.5.2 +******************** + +Fixes +----- + + * Issue [#16](https://github.com/daltonmatos/plugnplay/issues/16) - [Python 3.2] Unable to install 0.5.1 via pip or setup.py + * Issue [#18](https://github.com/daltonmatos/plugnplay/issues/18) - Incompatibility with py3k filter() function + + + + New in version 0.5.1 ******************** diff --git a/plugnplay/__init__.py b/plugnplay/__init__.py index f1886d9..0a0830f 100644 --- a/plugnplay/__init__.py +++ b/plugnplay/__init__.py @@ -6,7 +6,7 @@ from .manager import Manager -__version__ = "0.5.1" +__version__ = "0.5.2" __all__ = ['Interface', 'Plugin'] PNP_SYS_MODULES_PREFIX = 'pnp' @@ -39,7 +39,8 @@ class InterfaceMeta(type): def __new__(metaclass, classname, bases, attrs): new_class = super(InterfaceMeta, metaclass).__new__(metaclass, classname, bases, attrs) - for k, v in new_class.__dict__.iteritems(): + for k in new_class.__dict__: + v = new_class.__dict__[k] if _is_method(v): setattr(new_class, k, classmethod(method_name(k))) @@ -86,7 +87,8 @@ def set_plugin_dirs(*dirs): def normalize_path(path): if path: - parts = filter(None, path.replace('.', '').split('/')) + _parts = filter(None, path.replace('.', '').split('/')) + parts = [p for p in _parts] # Exhaust the generator, returned by py3k's filter() function # Prefix all modules imported by plugnplay with a common value return '.'.join([PNP_SYS_MODULES_PREFIX] + parts) return None diff --git a/tests/loading.py b/tests/loading.py index bf91af8..be1a22c 100644 --- a/tests/loading.py +++ b/tests/loading.py @@ -64,11 +64,9 @@ def test_load_same_name_different_folders(self): self.assertTrue(dir2_norm + '.otherplugin' in sys.modules) mod1 = sys.modules[dir1_norm + '.otherplugin'] - print mod1 self.assertTrue(mod1.MyPlugin.dir1) mod2 = sys.modules[dir2_norm + '.otherplugin'] - print mod2 self.assertTrue(mod2.MyPlugin.dir2) def test_find_implementors_different_import(self):