Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for specifying the screenshot location and filename #4181

Merged
merged 9 commits into from
Feb 19, 2024

Conversation

davep
Copy link
Contributor

@davep davep commented Feb 19, 2024

Implements the Textual side of #3795; adding two new environment variables that work alongside TEXTUAL_SCREENSHOT:

  • TEXTUAL_SCREENSHOT_LOCATION -- the directory where the screenshot should be saved.
  • TEXTUAL_SCREENSHOT_FILENAME -- the filename to give the screenshot.

With this change you can do something like this:

TEXTUAL_SCREENSHOT_LOCATION=/Users/davep TEXTUAL_SCREENSHOT_FILENAME=foo.svg TEXTUAL_SCREENSHOT=1 poetry run python -m textual

which will save a screenshot called foo.svg in /Users/davep after 1 second.

This change serves an incoming PR to textual-dev.

@davep davep self-assigned this Feb 19, 2024
@davep davep added enhancement New feature or request Task labels Feb 19, 2024
@davep davep marked this pull request as ready for review February 19, 2024 15:18
Copy link
Contributor

@rodrigogiraoserrao rodrigogiraoserrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment on lines 12 to +15
- Added support for environment variable `TEXTUAL_ANIMATIONS` to control what animations Textual displays https://github.com/Textualize/textual/pull/4062
- Add attribute `App.animation_level` to control whether animations on that app run or not https://github.com/Textualize/textual/pull/4062
- Added support for a `TEXTUAL_SCREENSHOT_LOCATION` environment variable to specify the location of an automated screenshot https://github.com/Textualize/textual/pull/4181/
- Added support for a `TEXTUAL_SCREENSHOT_FILENAME` environment variable to specify the filename of an automated screenshot https://github.com/Textualize/textual/pull/4181/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.52.0 will be “The Env Vars release”

@davep davep merged commit 1604c2b into Textualize:main Feb 19, 2024
20 checks passed
@davep davep deleted the screenshot-location branch February 19, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to set the screenshot path in textual run
3 participants