Open nricciardi opened 1 year ago
Hello,
I'm struggling to reproduce the issue
Does using @eel.expose
work?
Can you share some more information if you are still facing the issue?
Thanks
Thanks for interesting.
I can't use @eel.expose
because it doesn't allow me to use alias.
Anyway, I have a class Test
which accepts an object obj
as parameter to be initialized, it has a method test
where uses obj
.
class Test:
def __init__(self, obj):
self.obj = obj
def test(self):
a = self.obj.a + "!!!"
return a
test = Test(obj)
eel._expose(test.test, "foo")
Then I would expose a new method with the same name (foo
).
I don't get your error it just doesn't work. As per #679 Couldn't you wrap it in a function?
class Test:
def __init__(self, obj):
self.obj = obj
def test(self):
a = self.obj.a + "!!!"
return a
test = Test(obj)
@eel.expose
def call_test():
data = test.test()
print(data)
This seems to work and I don't see a problem with it - not the nicest way of doing it but
Thanks for answering me, but I change the test reference after first assignment, this is the problem in my point of view.
Hi, I'm trying to expose the method
test
of classTest
usingeel._expose(test, 'foo')
, but I have an error:AssertionError: Already exposed function with name "test"
How to fix it?