Updated "factory_config" decorator so that decorated class automatically implements interface provided by factory
--- a/src/pyams_utils/factory.py Fri Dec 07 16:10:26 2018 +0100
+++ b/src/pyams_utils/factory.py Tue Dec 11 09:38:24 2018 +0100
@@ -64,7 +64,7 @@
# import packages
from pyams_utils.registry import get_global_registry
from zope.component import adapter, queryAdapter
-from zope.interface import implementer, Interface
+from zope.interface import implementer, Interface, provider, classImplements
from zope.interface.interface import InterfaceClass
@@ -103,6 +103,7 @@
"""
class Temp(ObjectFactoryAdapter):
+ classImplements(klass, interface)
factory = klass
if_name = get_interface_name(interface)
@@ -118,7 +119,8 @@
venusian = venusian
- def __init__(self, **settings):
+ def __init__(self, provided, **settings):
+ settings['provided'] = provided
self.__dict__.update(settings)
def __call__(self, wrapped):