mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
@@ -183,7 +183,7 @@ def parse_declarations(css: str, path: str) -> Styles:
|
|||||||
styles_builder = StylesBuilder()
|
styles_builder = StylesBuilder()
|
||||||
|
|
||||||
declaration: Declaration | None = None
|
declaration: Declaration | None = None
|
||||||
errors: list[tuple[Token, str]] = []
|
errors: list[tuple[Token, str | HelpText]] = []
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
token = next(tokens, None)
|
token = next(tokens, None)
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ class DOMQuery(Generic[QueryType]):
|
|||||||
# The IndexError was got, that's a good thing in this case. So
|
# The IndexError was got, that's a good thing in this case. So
|
||||||
# we return what we found.
|
# we return what we found.
|
||||||
pass
|
pass
|
||||||
return the_one
|
return cast("Widget", the_one)
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def last(self) -> Widget:
|
def last(self) -> Widget:
|
||||||
|
|||||||
@@ -474,7 +474,7 @@ class StylesBase(ABC):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@lru_cache(maxsize=1024)
|
@lru_cache(maxsize=1024)
|
||||||
def parse(cls, css: str, path: str, *, node: DOMNode = None) -> Styles:
|
def parse(cls, css: str, path: str, *, node: DOMNode | None = None) -> Styles:
|
||||||
"""Parse CSS and return a Styles object.
|
"""Parse CSS and return a Styles object.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class DOMNode(MessagePump):
|
|||||||
_css_type_names: ClassVar[frozenset[str]] = frozenset()
|
_css_type_names: ClassVar[frozenset[str]] = frozenset()
|
||||||
|
|
||||||
# Generated list of bindings
|
# Generated list of bindings
|
||||||
_merged_bindings: ClassVar[Bindings] | None = None
|
_merged_bindings: ClassVar[Bindings | None] = None
|
||||||
|
|
||||||
_reactives: ClassVar[dict[str, Reactive]]
|
_reactives: ClassVar[dict[str, Reactive]]
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ class Screen(Widget):
|
|||||||
else:
|
else:
|
||||||
# Only move the focus if we are currently showing the focus
|
# Only move the focus if we are currently showing the focus
|
||||||
if direction:
|
if direction:
|
||||||
to_focus: Widget | None = None
|
to_focus = None
|
||||||
chain_length = len(focus_chain)
|
chain_length = len(focus_chain)
|
||||||
for step in range(1, len(focus_chain) + 1):
|
for step in range(1, len(focus_chain) + 1):
|
||||||
node = focus_chain[
|
node = focus_chain[
|
||||||
|
|||||||
Reference in New Issue
Block a user