Skip to content

Commit

Permalink
✨ textual upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
juftin authored Jul 23, 2023
1 parent 830d1cf commit f49febc
Show file tree
Hide file tree
Showing 6 changed files with 1,139 additions and 1,155 deletions.
8 changes: 4 additions & 4 deletions browsr/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pathlib
from dataclasses import dataclass
from textwrap import dedent
from typing import Any, Dict, Optional, Union
from typing import Any, ClassVar, Dict, List, Optional, Union

import numpy as np
import upath
Expand All @@ -19,7 +19,7 @@
from rich.text import Text
from textual import on
from textual.app import App, ComposeResult
from textual.binding import Binding
from textual.binding import Binding, BindingType
from textual.containers import Container, VerticalScroll
from textual.reactive import reactive, var
from textual.widget import Widget
Expand Down Expand Up @@ -247,7 +247,7 @@ class VimScroll(VerticalScroll):
A VerticalScroll with Vim Keybindings
"""

BINDINGS = [
BINDINGS: ClassVar[List[BindingType]] = [
*VerticalScroll.BINDINGS,
*vim_scroll_bindings,
]
Expand All @@ -258,7 +258,7 @@ class VimDataTable(DataTable[str]):
A DataTable with Vim Keybindings
"""

BINDINGS = [
BINDINGS: ClassVar[List[BindingType]] = [
*DataTable.BINDINGS,
*vim_cursor_bindings,
]
6 changes: 3 additions & 3 deletions browsr/browsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import shutil
from os import getenv
from textwrap import dedent
from typing import TYPE_CHECKING, Any, Iterable, Optional, Union
from typing import TYPE_CHECKING, Any, ClassVar, Iterable, List, Optional, Union

import pandas as pd
import upath
Expand All @@ -20,7 +20,7 @@
from rich.traceback import Traceback
from rich_pixels import Pixels
from textual import on
from textual.binding import Binding
from textual.binding import Binding, BindingType
from textual.containers import Container, Horizontal
from textual.events import Mount
from textual.reactive import var
Expand Down Expand Up @@ -59,7 +59,7 @@ class Browsr(BrowsrTextualApp):

TITLE = __application__
CSS_PATH = "browsr.css"
BINDINGS = [
BINDINGS: ClassVar[List[BindingType]] = [
Binding(key="q", action="quit", description="Quit"),
Binding(key="f", action="toggle_files", description="Toggle Files"),
Binding(key="t", action="theme", description="Toggle Theme"),
Expand Down
5 changes: 3 additions & 2 deletions browsr/universal_directory_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

from __future__ import annotations

from typing import Iterable, Optional
from typing import ClassVar, Iterable, List, Optional

from textual.binding import BindingType
from textual.widgets._directory_tree import DirEntry
from textual.widgets._tree import TreeNode
from textual_universal_directorytree import UniversalDirectoryTree
Expand All @@ -19,7 +20,7 @@ class BrowsrDirectoryTree(UniversalDirectoryTree):
A DirectoryTree that can handle any filesystem.
"""

BINDINGS = [
BINDINGS: ClassVar[List[BindingType]] = [
*UniversalDirectoryTree.BINDINGS,
*vim_cursor_bindings,
]
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies = [
"rich~=13.3.5",
"rich-click~=1.5.2",
"rich-pixels~=2.1.1",
"textual==0.28.1",
"textual==0.30.0",
"textual-universal-directorytree~=1.0.1",
"Pillow>=9.1.0",
"PyMuPDF~=1.22.3"
Expand Down Expand Up @@ -79,7 +79,7 @@ dependencies = [
"mypy~=1.2.0",
"pandas-stubs~=2.0.0.230412",
"pip-tools~=6.13.0",
"textual[dev]==0.28.1"
"textual-dev~=1.0.1"
]
features = ["all"]
pre-install-commands = ["pip install -U --no-deps -r requirements/requirements-dev.txt"]
Expand Down
Loading

0 comments on commit f49febc

Please sign in to comment.