Replace isort with ruff

This commit is contained in:
Kovid Goyal
2023-01-09 16:47:42 +05:30
parent f15d27bb62
commit 7fe5d7b58f
157 changed files with 876 additions and 732 deletions

View File

@@ -6,16 +6,21 @@ from collections import deque
from contextlib import suppress
from time import monotonic
from types import TracebackType
from typing import (
TYPE_CHECKING, Any, Callable, ContextManager, Deque, Dict, NamedTuple,
Optional, Sequence, Type, Union, cast
)
from typing import TYPE_CHECKING, Any, Callable, ContextManager, Deque, Dict, NamedTuple, Optional, Sequence, Type, Union, cast
from kitty.types import DecoratedFunc, ParsedShortcut
from kitty.typing import (
AbstractEventLoop, BossType, Debug, ImageManagerType, KeyActionType,
KeyEventType, LoopType, MouseButton, MouseEvent, ScreenSize,
TermManagerType
AbstractEventLoop,
BossType,
Debug,
ImageManagerType,
KeyActionType,
KeyEventType,
LoopType,
MouseButton,
MouseEvent,
ScreenSize,
TermManagerType,
)
from .operations import MouseTracking, pending_update

View File

@@ -9,17 +9,11 @@ from collections import defaultdict, deque
from contextlib import suppress
from enum import IntEnum
from itertools import count
from typing import (
Any, Callable, ClassVar, DefaultDict, Deque, Dict, Generic, Iterator, List,
Optional, Sequence, Tuple, Type, TypeVar, Union, cast
)
from typing import Any, Callable, ClassVar, DefaultDict, Deque, Dict, Generic, Iterator, List, Optional, Sequence, Tuple, Type, TypeVar, Union, cast
from kitty.conf.utils import positive_float, positive_int
from kitty.fast_data_types import create_canvas
from kitty.typing import (
GRT_C, CompletedProcess, GRT_a, GRT_d, GRT_f, GRT_m, GRT_o, GRT_t,
HandlerType
)
from kitty.typing import GRT_C, CompletedProcess, GRT_a, GRT_d, GRT_f, GRT_m, GRT_o, GRT_t, HandlerType
from kitty.utils import ScreenSize, fit_image, which
from .operations import cursor

View File

@@ -6,9 +6,7 @@ from typing import Callable, Tuple
from kitty.fast_data_types import truncate_point_for_length, wcswidth
from kitty.key_encoding import EventType, KeyEvent
from .operations import (
RESTORE_CURSOR, SAVE_CURSOR, move_cursor_by, set_cursor_shape
)
from .operations import RESTORE_CURSOR, SAVE_CURSOR, move_cursor_by, set_cursor_shape
class LineEdit:

View File

@@ -16,17 +16,10 @@ from functools import partial
from typing import Any, Callable, Dict, Generator, List, NamedTuple, Optional
from kitty.constants import is_macos
from kitty.fast_data_types import (
FILE_TRANSFER_CODE, close_tty, normal_tty, open_tty,
parse_input_from_terminal, raw_tty
)
from kitty.key_encoding import (
ALT, CTRL, SHIFT, backspace_key, decode_key_event, enter_key
)
from kitty.fast_data_types import FILE_TRANSFER_CODE, close_tty, normal_tty, open_tty, parse_input_from_terminal, raw_tty
from kitty.key_encoding import ALT, CTRL, SHIFT, backspace_key, decode_key_event, enter_key
from kitty.typing import ImageManagerType, KeyEventType, Protocol
from kitty.utils import (
ScreenSize, ScreenSizeGetter, screen_size_function, write_all
)
from kitty.utils import ScreenSize, ScreenSizeGetter, screen_size_function, write_all
from .handler import Handler
from .operations import MouseTracking, init_state, reset_state

View File

@@ -9,9 +9,7 @@ from typing import IO, Any, Callable, Dict, Generator, Optional, TypeVar, Union
from kitty.fast_data_types import Color
from kitty.rgb import color_as_sharp, to_color
from kitty.typing import (
GraphicsCommandType, HandlerType, ScreenSize, UnderlineLiteral
)
from kitty.typing import GraphicsCommandType, HandlerType, ScreenSize, UnderlineLiteral
from .operations_stub import CMD

View File

@@ -2,7 +2,7 @@
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
from .operations import styled, repeat
from .operations import repeat, styled
def render_progress_bar(frac: float, width: int = 80) -> str: