method registering #154
Unanswered
BobMessiaen
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Methods can only be plain functions, however you can pass any object to the methods using context which should give you what you need. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Dear Beau,
We want to upgrade from version 3.4.2 to 4.2. But to me it looks like you cannot longer methods from a class (unless they are static methods)?
Is there a way you can you can add a method from a class (not a static method)?
Some sample code to illustrate what we were doing before:
class YYY
def xxxx(self):
pass
We registered the function as
yyy = YYY()
m = "xxxx"
methods.add(getattr(yyy, m), "yyy.{}".format(m))
where the jsonrpc method to access the function was:
yyy.xxxx
How can we achieve the same thing with version 4.2 ?
Thanks in advance for your response!
Bob
Beta Was this translation helpful? Give feedback.
All reactions