Skip to content

Commit

Permalink
chore: fix typing for RUF wanting ClassVar
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Jul 11, 2023
1 parent 6b5d8bf commit c63a13c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repos:
files: src
additional_dependencies:
- rich>=12
- click>=8.1.1
- click==8.1.3
- hist
- numpy
- textual>=0.27
Expand Down
6 changes: 4 additions & 2 deletions src/uproot_browser/tui/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import contextlib
import sys
from pathlib import Path
from typing import Any
from typing import Any, ClassVar

import plotext as plt
import rich.syntax
Expand Down Expand Up @@ -53,7 +53,9 @@ class Browser(textual.app.App[object]):
"""A basic implementation of the uproot-browser TUI"""

CSS_PATH = "browser.css"
BINDINGS = [
BINDINGS: ClassVar[
list[textual.binding.Binding | tuple[str, str] | tuple[str, str, str]]
] = [
textual.binding.Binding("b", "toggle_files", "Navbar"),
textual.binding.Binding("q", "quit", "Quit"),
textual.binding.Binding("d", "quit_with_dump", "Dump & Quit"),
Expand Down
5 changes: 4 additions & 1 deletion src/uproot_browser/tui/help.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import typing
from typing import ClassVar

import textual.app
import textual.binding
Expand All @@ -20,7 +21,9 @@


class HelpScreen(ModalScreen):
BINDINGS = [
BINDINGS: ClassVar[
list[textual.binding.Binding | tuple[str, str] | tuple[str, str, str]]
] = [
textual.binding.Binding("d", "", "Nothing", show=False),
textual.binding.Binding("b", "", "Nothing", show=False),
textual.binding.Binding("f1", "", "Nothing", show=False),
Expand Down
6 changes: 4 additions & 2 deletions src/uproot_browser/tui/left_panel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from pathlib import Path
from typing import Any
from typing import Any, ClassVar

import rich.panel
import rich.repr
Expand All @@ -28,7 +28,9 @@ def __init__(self, upfile: Any, path: str) -> None:
class UprootTree(textual.widgets.Tree[UprootEntry]):
"""currently just extending DirectoryTree, showing current path"""

BINDINGS = [
BINDINGS: ClassVar[
list[textual.binding.Binding | tuple[str, str] | tuple[str, str, str]]
] = [
textual.binding.Binding("h", "cursor_out", "Cursor out", show=False),
textual.binding.Binding("j", "cursor_down", "Cursor Down", show=False),
textual.binding.Binding("k", "cursor_up", "Cursor Up", show=False),
Expand Down

0 comments on commit c63a13c

Please sign in to comment.