mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Ensure docks error thrown correctly
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#uber1 {
|
||||
layout: dock;
|
||||
docks: x=left/y;
|
||||
docks: x=left/2 y=right/3;
|
||||
background: dark_green;
|
||||
overflow: auto auto;
|
||||
border: heavy white;
|
||||
@@ -11,5 +11,5 @@
|
||||
min-width: 80;
|
||||
background: dark_blue;
|
||||
padding: 2;
|
||||
border: solid x;
|
||||
border: solid red;
|
||||
}
|
||||
|
||||
@@ -335,21 +335,19 @@ def docks_property_help_text(
|
||||
],
|
||||
css=[
|
||||
Bullet(
|
||||
f"The [i]{property_name}[/] property expects a value of the form <name>=<edge>/<zindex>"
|
||||
),
|
||||
Bullet("<name> can be any string you want"),
|
||||
Bullet(f"<edge> must be one of {friendly_list(VALID_EDGE)}"),
|
||||
Bullet(
|
||||
f"<zindex> must be an integer",
|
||||
f"The [i]{property_name}[/] property expects a value of the form <name>=<edge>/<zindex>...",
|
||||
examples=[
|
||||
Example(
|
||||
f"{property_name}: lhs=left/2; [dim]# dock named [u]lhs[/], on [u]left[/] edge, with z-index [u]2[/]"
|
||||
),
|
||||
Example(
|
||||
f"{property_name}: top=top/3; [dim]# dock named [u]top[/], on [u]top[/] edge, with z-index [u]3[/]"
|
||||
f"{property_name}: top=top/3 rhs=right/2; [dim]# declaring multiple docks"
|
||||
),
|
||||
],
|
||||
),
|
||||
Bullet("<name> can be any string you want"),
|
||||
Bullet(f"<edge> must be one of {friendly_list(VALID_EDGE)}"),
|
||||
Bullet(f"<zindex> must be an integer"),
|
||||
],
|
||||
).get_by_context(context)
|
||||
],
|
||||
|
||||
@@ -570,8 +570,7 @@ class StylesBuilder:
|
||||
z = 0
|
||||
if number:
|
||||
if not number.isdigit():
|
||||
pass
|
||||
docks_error(name, token)
|
||||
docks_error(name, token)
|
||||
z = int(number)
|
||||
if edge_name not in VALID_EDGE:
|
||||
docks_error(name, token)
|
||||
|
||||
Reference in New Issue
Block a user