From c2c29222e55d5e5f735ba8a1735d15bd8a6f7bb1 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Wed, 27 Apr 2022 12:39:53 +0100 Subject: [PATCH] Docstrings --- sandbox/uber.css | 1 - src/textual/css/_help_text.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/sandbox/uber.css b/sandbox/uber.css index 8ebe91c8f..3407e53f3 100644 --- a/sandbox/uber.css +++ b/sandbox/uber.css @@ -1,7 +1,6 @@ #uber1 { layout: vertical; background: dark_green; - overflow-x: x; border: heavy white; } diff --git a/src/textual/css/_help_text.py b/src/textual/css/_help_text.py index 5fd4ec9b3..e8738cb22 100644 --- a/src/textual/css/_help_text.py +++ b/src/textual/css/_help_text.py @@ -556,6 +556,14 @@ def fractional_property_help_text( def offset_property_help_text(context: StylingContext | None) -> HelpText: + """Help text to show when the user supplies an invalid value for the offset property. + + Args: + context (StylingContext | None): The context the property is being used in. + + Returns: + HelpText: Renderable for displaying the help text for this property + """ return HelpText( summary="Invalid value for [i]offset[/] property", bullets=[ @@ -588,6 +596,11 @@ def offset_property_help_text(context: StylingContext | None) -> HelpText: def align_help_text() -> HelpText: + """Help text to show when the user supplies an invalid value for a `align`. + + Returns: + HelpText: Renderable for displaying the help text for this property + """ return HelpText( summary="Invalid value for [i]align[/] property", bullets=[ @@ -614,6 +627,14 @@ def align_help_text() -> HelpText: def offset_single_axis_help_text(property_name: str) -> HelpText: + """Help text to show when the user supplies an invalid value for an offset-* property. + + Args: + property_name (str): The name of the property + + Returns: + HelpText: Renderable for displaying the help text for this property + """ return HelpText( summary=f"Invalid value for [i]{property_name}[/]", bullets=[ @@ -632,6 +653,15 @@ def offset_single_axis_help_text(property_name: str) -> HelpText: def style_flags_property_help_text( property_name: str, value: str, context: StylingContext | None ) -> HelpText: + """Help text to show when the user supplies an invalid value for a style flags property. + + Args: + property_name (str): The name of the property + context (StylingContext | None): The context the property is being used in. + + Returns: + HelpText: Renderable for displaying the help text for this property + """ property_name = _contextualize_property_name(property_name, context) return HelpText( summary=f"Invalid value '{value}' in [i]{property_name}[/] property",