MCPcopy Index your code
hub / github.com/plotly/plotly.py / PlotlyScopeWrapper

Class PlotlyScopeWrapper

plotly/io/_kaleido.py:98–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97 # Show a deprecation warning if the old method of setting defaults is used
98 class PlotlyScopeWrapper(PlotlyScope):
99 def __setattr__(self, name, value):
100 if name in defaults.__dict__:
101 if ENABLE_KALEIDO_V0_DEPRECATION_WARNINGS:
102 warnings.warn(
103 kaleido_scope_default_warning_func(name),
104 DeprecationWarning,
105 stacklevel=2,
106 )
107 super().__setattr__(name, value)
108
109 def __getattr__(self, name):
110 if hasattr(defaults, name):
111 if ENABLE_KALEIDO_V0_DEPRECATION_WARNINGS:
112 warnings.warn(
113 kaleido_scope_default_warning_func(name),
114 DeprecationWarning,
115 stacklevel=2,
116 )
117 return super().__getattr__(name)
118
119 # Ensure the new method of setting defaults is backwards compatible with Kaleido v0
120 # DefaultsBackwardsCompatible sets the attributes on `scope` object at the same time

Callers 1

_kaleido.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected