Skip to content

Commit f49febc

Browse files
authored
✨ textual upgrade
1 parent 830d1cf commit f49febc

File tree

6 files changed

+1139
-1155
lines changed

6 files changed

+1139
-1155
lines changed

browsr/_base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import pathlib
99
from dataclasses import dataclass
1010
from textwrap import dedent
11-
from typing import Any, Dict, Optional, Union
11+
from typing import Any, ClassVar, Dict, List, Optional, Union
1212

1313
import numpy as np
1414
import upath
@@ -19,7 +19,7 @@
1919
from rich.text import Text
2020
from textual import on
2121
from textual.app import App, ComposeResult
22-
from textual.binding import Binding
22+
from textual.binding import Binding, BindingType
2323
from textual.containers import Container, VerticalScroll
2424
from textual.reactive import reactive, var
2525
from textual.widget import Widget
@@ -247,7 +247,7 @@ class VimScroll(VerticalScroll):
247247
A VerticalScroll with Vim Keybindings
248248
"""
249249

250-
BINDINGS = [
250+
BINDINGS: ClassVar[List[BindingType]] = [
251251
*VerticalScroll.BINDINGS,
252252
*vim_scroll_bindings,
253253
]
@@ -258,7 +258,7 @@ class VimDataTable(DataTable[str]):
258258
A DataTable with Vim Keybindings
259259
"""
260260

261-
BINDINGS = [
261+
BINDINGS: ClassVar[List[BindingType]] = [
262262
*DataTable.BINDINGS,
263263
*vim_cursor_bindings,
264264
]

browsr/browsr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import shutil
1111
from os import getenv
1212
from textwrap import dedent
13-
from typing import TYPE_CHECKING, Any, Iterable, Optional, Union
13+
from typing import TYPE_CHECKING, Any, ClassVar, Iterable, List, Optional, Union
1414

1515
import pandas as pd
1616
import upath
@@ -20,7 +20,7 @@
2020
from rich.traceback import Traceback
2121
from rich_pixels import Pixels
2222
from textual import on
23-
from textual.binding import Binding
23+
from textual.binding import Binding, BindingType
2424
from textual.containers import Container, Horizontal
2525
from textual.events import Mount
2626
from textual.reactive import var
@@ -59,7 +59,7 @@ class Browsr(BrowsrTextualApp):
5959

6060
TITLE = __application__
6161
CSS_PATH = "browsr.css"
62-
BINDINGS = [
62+
BINDINGS: ClassVar[List[BindingType]] = [
6363
Binding(key="q", action="quit", description="Quit"),
6464
Binding(key="f", action="toggle_files", description="Toggle Files"),
6565
Binding(key="t", action="theme", description="Toggle Theme"),

browsr/universal_directory_tree.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
from __future__ import annotations
66

7-
from typing import Iterable, Optional
7+
from typing import ClassVar, Iterable, List, Optional
88

9+
from textual.binding import BindingType
910
from textual.widgets._directory_tree import DirEntry
1011
from textual.widgets._tree import TreeNode
1112
from textual_universal_directorytree import UniversalDirectoryTree
@@ -19,7 +20,7 @@ class BrowsrDirectoryTree(UniversalDirectoryTree):
1920
A DirectoryTree that can handle any filesystem.
2021
"""
2122

22-
BINDINGS = [
23+
BINDINGS: ClassVar[List[BindingType]] = [
2324
*UniversalDirectoryTree.BINDINGS,
2425
*vim_cursor_bindings,
2526
]

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies = [
2020
"rich~=13.3.5",
2121
"rich-click~=1.5.2",
2222
"rich-pixels~=2.1.1",
23-
"textual==0.28.1",
23+
"textual==0.30.0",
2424
"textual-universal-directorytree~=1.0.1",
2525
"Pillow>=9.1.0",
2626
"PyMuPDF~=1.22.3"
@@ -79,7 +79,7 @@ dependencies = [
7979
"mypy~=1.2.0",
8080
"pandas-stubs~=2.0.0.230412",
8181
"pip-tools~=6.13.0",
82-
"textual[dev]==0.28.1"
82+
"textual-dev~=1.0.1"
8383
]
8484
features = ["all"]
8585
pre-install-commands = ["pip install -U --no-deps -r requirements/requirements-dev.txt"]

0 commit comments

Comments
 (0)