limelight.capture.camera
¶
SCREENSHOT_NAME_INVALID_PATTERN = re.compile('[^A-Za-z0-9._-]+')
module-attribute
¶
Camera
¶
A screenshot recorder for a demo run.
This class numbers each screenshot as it is taken, so the files sort in the order the demo produced them rather than by name.
The constructor for the Camera class.
Parameters:
-
page(Page) –The page the screenshots are taken from.
-
directory(Path) –The directory the screenshots are written to.
Raises:
-
ValueError–If the directory is empty or the current directory.
Source code in limelight/capture/camera.py
screenshot
¶
A method that captures the current page to a numbered PNG file.
Parameters:
-
name(str) –The label for the shot, with unusable characters replaced by a dash.
Returns:
-
Path–The path the screenshot was written to.
Raises:
-
ValueError–If the name carries no characters usable in a file name.
Source code in limelight/capture/camera.py
switch_page
¶
A method that points the camera at a different page.
Parameters:
-
page(Page) –The page later screenshots are taken from.