From b6e27ac6f76d910bd98c6b38cb7d38bc538fbbc3 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 10:02:34 +0100 Subject: [PATCH 1/5] Clean trailing whitespace --- docs/guide/actions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/actions.md b/docs/guide/actions.md index 958f82a0d..b8069e326 100644 --- a/docs/guide/actions.md +++ b/docs/guide/actions.md @@ -42,7 +42,7 @@ Action strings have the following format: - The name of an action on is own will call the action method with no parameters. For example, an action string of `"bell"` will call `action_bell()`. - Actions may be followed by braces containing Python objects. For example, the action string `set_background("red")` will call `action_set_background("red")`. -- Actions may be prefixed with a _namespace_ (see below) follow by a dot. +- Actions may be prefixed with a _namespace_ (see below) follow by a dot.
--8<-- "docs/images/actions/format.excalidraw.svg" @@ -104,7 +104,7 @@ The following example defines a custom widget with its own `set_background` acti === "actions05.css" - ```sass title="actions05.css" + ```sass title="actions05.css" --8<-- "docs/examples/guide/actions/actions05.css" ``` From 9527248bc0d69b9b5bd121bad24e6b56a6ce0057 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 10:06:57 +0100 Subject: [PATCH 2/5] Remove 's' from 'strings' --- docs/guide/actions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/actions.md b/docs/guide/actions.md index b8069e326..fd682cef9 100644 --- a/docs/guide/actions.md +++ b/docs/guide/actions.md @@ -50,7 +50,7 @@ Action strings have the following format: ### Parameters -If the action strings contains parameters, these must be valid Python literals. Which means you can include numbers, strings, dicts, lists etc. but you can't include variables or references to any other python symbols. +If the action string contains parameters, these must be valid Python literals. Which means you can include numbers, strings, dicts, lists etc. but you can't include variables or references to any other python symbols. Consequently `"set_background('blue')"` is a valid action string, but `"set_background(new_color)"` is not — because `new_color` is a variable and not a literal. From d7dc8d2203e86cd4c9f9378cc80cbdd196aca88e Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 10:08:24 +0100 Subject: [PATCH 3/5] Remove 's' from 'symbols' --- docs/guide/actions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/actions.md b/docs/guide/actions.md index fd682cef9..3784f9140 100644 --- a/docs/guide/actions.md +++ b/docs/guide/actions.md @@ -50,7 +50,7 @@ Action strings have the following format: ### Parameters -If the action string contains parameters, these must be valid Python literals. Which means you can include numbers, strings, dicts, lists etc. but you can't include variables or references to any other python symbols. +If the action string contains parameters, these must be valid Python literals. Which means you can include numbers, strings, dicts, lists etc. but you can't include variables or references to any other python symbol. Consequently `"set_background('blue')"` is a valid action string, but `"set_background(new_color)"` is not — because `new_color` is a variable and not a literal. From 95a1b831600ffc1cc1a59d0b523e1d8f131a8929 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 10:09:37 +0100 Subject: [PATCH 4/5] Make the bell belong to the terminal --- docs/guide/actions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/actions.md b/docs/guide/actions.md index 3784f9140..7a33a424e 100644 --- a/docs/guide/actions.md +++ b/docs/guide/actions.md @@ -71,7 +71,7 @@ The following example mounts simple static text with embedded action links. ```{.textual path="docs/examples/guide/actions/actions03.py"} ``` -When you click any of the links, Textual runs the `"set_background"` action to change the background to the given color and plays the terminals bell. +When you click any of the links, Textual runs the `"set_background"` action to change the background to the given color and plays the terminal's bell. ## Bindings From 614f30b301fc2e94ebad916f96fde123e9cde1dc Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 10:14:33 +0100 Subject: [PATCH 5/5] 'a' -> 'an' for SVG in docstrings An ess vee gee. --- src/textual/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/textual/app.py b/src/textual/app.py index 7cf010f3c..1e89de3c9 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -483,7 +483,7 @@ class App(Generic[ReturnType], DOMNode): self.dark = not self.dark def action_screenshot(self, filename: str | None, path: str = "~/") -> None: - """Save an SVG "screenshot". This action will save a SVG file containing the current contents of the screen. + """Save an SVG "screenshot". This action will save an SVG file containing the current contents of the screen. Args: filename (str | None, optional): Filename of screenshot, or None to auto-generate. Defaults to None. @@ -492,7 +492,7 @@ class App(Generic[ReturnType], DOMNode): self.save_screenshot(filename, path) def export_screenshot(self, *, title: str | None = None) -> str: - """Export a SVG screenshot of the current screen. + """Export an SVG screenshot of the current screen. Args: title (str | None, optional): The title of the exported screenshot or None @@ -519,7 +519,7 @@ class App(Generic[ReturnType], DOMNode): path: str = "./", time_format: str = "%Y-%m-%d %X %f", ) -> str: - """Save a SVG screenshot of the current screen. + """Save an SVG screenshot of the current screen. Args: filename (str | None, optional): Filename of SVG screenshot, or None to auto-generate