2019-11-05 21:18:20 +00:00
|
|
|
# type: ignore
|
|
|
|
|
|
|
|
|
2019-11-11 22:01:07 +00:00
|
|
|
class Proxy:
|
|
|
|
def __init__(self, proxied):
|
|
|
|
self.proxied = proxied
|
|
|
|
|
2019-11-05 21:18:20 +00:00
|
|
|
def __getattr__(self, attr):
|
2019-11-11 22:01:07 +00:00
|
|
|
if callable(self.proxied[attr]):
|
|
|
|
return lambda *x: self.proxied[attr](*x)
|
|
|
|
else:
|
|
|
|
return self.proxied[attr]
|
2019-11-05 21:18:20 +00:00
|
|
|
|
2019-11-13 22:21:57 +00:00
|
|
|
def __setattr__(self, attr, value):
|
|
|
|
self.proxied[attr] = value
|
|
|
|
|
2019-11-05 21:18:20 +00:00
|
|
|
|
2019-11-11 22:01:07 +00:00
|
|
|
_document = Proxy(document)
|
|
|
|
_window = Proxy(window)
|
2019-11-05 21:18:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|