# HG changeset patch # User Thierry Florac # Date 1544517504 -3600 # Node ID eb4222d62e58e142eece51ec56327db317865486 # Parent 2f480dcb3c76cb276d4264a7a4b4ae311c01c338 Updated "factory_config" decorator so that decorated class automatically implements interface provided by factory diff -r 2f480dcb3c76 -r eb4222d62e58 src/pyams_utils/factory.py --- 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):