-
Notifications
You must be signed in to change notification settings - Fork 240
Open
Description
In at least one instance (and in PR #758) we need to pass an is_screenshot_generator
cue to a View in order to alter rendering behavior (usually thread management) to be compatible with the screenshot generator.
Since the screenshot generator is just monkey patching over the normal Renderer
, we can probably just provide a test in the Controller
or maybe just directly in the Renderer
that can tell us which Renderer
is instantiated.
Actually, most likely it's easiest to just add a property to the Renderer
:
class Renderer:
@property
def is_screenshot_generator(self) -> bool:
return False
...
# in the tests world:
class ScreenshotRenderer(Renderer):
@property
def is_screenshot_generator(self) -> bool:
return True
So if we had this in place, in the few instances when a piece of code needs to alter its behavior for the screenshot renderer, we wouldn't have to explicitly pass in this is_screenshot_renderer
arg.
Chaitanya-Keyal
Metadata
Metadata
Assignees
Labels
No labels