-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Requires decorator can be inherit #99
Comments
I have troubles replicating the issue, you can find my test bundle below. Even when commenting the Do you have a sample code to see what happens ? from pelix.ipopo.decorators import (
ComponentFactory,
Requires,
Instantiate,
Validate,
Provides,
)
from pelix.framework import create_framework
@ComponentFactory()
@Provides("foo")
@Instantiate("foo")
class Foo:
pass
@ComponentFactory()
@Provides("bar")
@Instantiate("bar")
class Bar:
pass
@ComponentFactory()
@Provides("baz")
@Instantiate("baz")
class Baz:
pass
@Requires("tutu", "baz")
class GrandParent:
def __init__(self):
self.tutu = None
@ComponentFactory()
@Requires("toto", "foo")
@Instantiate("parent")
class Parent(GrandParent):
def __init__(self):
super().__init__()
self.toto = None
@Validate
def validate(self, ctx):
print("Parent ## tutu=", self.tutu, "toto=", self.toto)
@ComponentFactory()
@Requires("titi", "bar")
@Instantiate("child")
class Child(Parent):
def __init__(self):
super().__init__()
self.titi = None
@Validate
def validate(self, ctx):
print(
"Child ## tutu=", self.tutu, "toto=", self.toto, "titi=", self.titi
) Here is a sample output:
|
I'll see to provide you asap the code sample. |
No news on this issues and I couldn't reproduce it. |
As property decorator that can be inherit from an super class. it cloud be interesting to inherit @requires decorator from a superclass to prevent to set it to the all child classes if they all have the same require instance to be injected unlike ipojo
The text was updated successfully, but these errors were encountered: