You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lexonomy_custom_editor/src/browser/internal.py

23 lines
411 B

# type: ignore
class Proxy:
def __init__(self, proxied):
self.proxied = proxied
def __getattr__(self, attr):
if callable(self.proxied[attr]):
return lambda *x: self.proxied[attr](*x)
else:
return self.proxied[attr]
def __setattr__(self, attr, value):
self.proxied[attr] = value
_document = Proxy(document)
_window = Proxy(window)