You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When user's code creates MyClientHandler it can use these interfaces to check if his callbacks signatures are declared properly - to look for typos or deprecated callbacks removed from upstream CEF. Also would be useful for auto completion.
These handlers interfaces should be auto generated from source code - create it as part of translator.py? (Issue #214)
Python has the concept of abc - Abstract Bases Classes - see:
class ClientHandler(metaclass=ABCMeta):
__subclass__ = {DisplayHandler, LifespanHandler, ...}
class MyClientHandler:
def __init__(self):
assert issubclass(MyClientHandler, ClientHandler)
The example above probably requires implementing all callbacks - we only need to validate functions that have been declared. Whether such callback name is valid and whether its number of parameters are valid.
Also do this for other non-handler classes, but which also act as callbacks:
StringVisitor
CookieVisitor
WebRequestClient
The text was updated successfully, but these errors were encountered:
Current Chrome 47 will break backward compatibility due to changes in upstream CEF. CEF Python depends on CEF and there will be more BC breaks in the future, can't do much about that. It would be good if such BC breaks could be detected by pylint or an IDE like PyCharm. That's why the need for client handler interfaces. It needs to able to be checked programmatically whether a callback with such name exists and wheter its arguments are valid (number and types if possible).
Module cefpython.handlers.
When user's code creates MyClientHandler it can use these interfaces to check if his callbacks signatures are declared properly - to look for typos or deprecated callbacks removed from upstream CEF. Also would be useful for auto completion.
These handlers interfaces should be auto generated from source code - create it as part of translator.py? (Issue #214)
Python has the concept of abc - Abstract Bases Classes - see:
Example:
The example above probably requires implementing all callbacks - we only need to validate functions that have been declared. Whether such callback name is valid and whether its number of parameters are valid.
Also do this for other non-handler classes, but which also act as callbacks:
The text was updated successfully, but these errors were encountered: