Ensure docks error thrown correctly

This commit is contained in:
Darren Burns
2022-04-25 15:28:11 +01:00
parent 34f4f5b8cc
commit 37f18247b5
3 changed files with 8 additions and 11 deletions

View File

@@ -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;
}

View File

@@ -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)
],

View File

@@ -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)