mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 22:44:50 +02:00
rename typing module to avoid conflicts with stdlib typing
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
import sys
|
||||
|
||||
from kitty.typing import BossType, TypedDict
|
||||
from kitty.typing_compat import BossType, TypedDict
|
||||
|
||||
from ..tui.handler import result_handler
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ from kitty.key_encoding import encode_key_event
|
||||
from kitty.rc.base import MATCH_TAB_OPTION, MATCH_WINDOW_OPTION
|
||||
from kitty.remote_control import create_basic_command, encode_send
|
||||
from kitty.short_uuid import uuid4
|
||||
from kitty.typing import KeyEventType, ScreenSize
|
||||
from kitty.typing_compat import KeyEventType, ScreenSize
|
||||
|
||||
from ..tui.handler import Handler
|
||||
from ..tui.line_edit import LineEdit
|
||||
|
||||
@@ -27,7 +27,7 @@ from kitty.fonts.list import create_family_groups
|
||||
from kitty.fonts.render import display_bitmap
|
||||
from kitty.options.types import Options
|
||||
from kitty.options.utils import parse_font_spec
|
||||
from kitty.typing import NotRequired
|
||||
from kitty.typing_compat import NotRequired
|
||||
from kitty.utils import screen_size_function
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
||||
@@ -10,7 +10,7 @@ from kitty.cli_stub import HintsCLIOptions
|
||||
from kitty.clipboard import set_clipboard_string, set_primary_selection
|
||||
from kitty.constants import website_url
|
||||
from kitty.fast_data_types import get_options
|
||||
from kitty.typing import BossType, WindowType
|
||||
from kitty.typing_compat import BossType, WindowType
|
||||
from kitty.utils import get_editor, resolve_custom_file
|
||||
|
||||
from ..tui.handler import result_handler
|
||||
|
||||
@@ -31,7 +31,7 @@ from kitty.fast_data_types import (
|
||||
from kitty.os_window_size import WindowSizeData, edge_spacing
|
||||
from kitty.simple_cli_definitions import listen_on_defn
|
||||
from kitty.types import LayerShellConfig
|
||||
from kitty.typing import BossType, EdgeLiteral
|
||||
from kitty.typing_compat import BossType, EdgeLiteral
|
||||
from kitty.utils import log_error
|
||||
|
||||
quake = (
|
||||
|
||||
@@ -15,7 +15,7 @@ from typing import Any, Optional
|
||||
from kitty.cli import parse_args
|
||||
from kitty.cli_stub import RemoteFileCLIOptions
|
||||
from kitty.constants import cache_dir
|
||||
from kitty.typing import BossType
|
||||
from kitty.typing_compat import BossType
|
||||
from kitty.utils import SSHConnectionData, command_for_open, get_editor, open_cmd
|
||||
|
||||
from ..tui.handler import result_handler
|
||||
|
||||
@@ -12,7 +12,7 @@ from typing import TYPE_CHECKING, Any, NamedTuple, cast
|
||||
|
||||
from kitty.constants import list_kitty_resources
|
||||
from kitty.types import run_once
|
||||
from kitty.typing import BossType, WindowType
|
||||
from kitty.typing_compat import BossType, WindowType
|
||||
from kitty.utils import resolve_abs_or_config_path
|
||||
|
||||
aliases = {'url_hints': 'hints'}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Callable, Union
|
||||
|
||||
from kitty.typing import ReadableBuffer, WriteableBuffer
|
||||
from kitty.typing_compat import ReadableBuffer, WriteableBuffer
|
||||
|
||||
class RsyncError(Exception):
|
||||
pass
|
||||
|
||||
@@ -12,7 +12,7 @@ from typing import TYPE_CHECKING, Any, ContextManager, Deque, NamedTuple, Option
|
||||
from kitty.constants import kitten_exe, running_in_kitty
|
||||
from kitty.fast_data_types import monotonic, safe_pipe
|
||||
from kitty.types import DecoratedFunc, ParsedShortcut
|
||||
from kitty.typing import (
|
||||
from kitty.typing_compat import (
|
||||
AbstractEventLoop,
|
||||
BossType,
|
||||
Debug,
|
||||
|
||||
@@ -14,7 +14,7 @@ from typing import Any, ClassVar, DefaultDict, Deque, Generic, Optional, TypeVar
|
||||
|
||||
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_compat 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
|
||||
|
||||
@@ -19,7 +19,7 @@ from typing import Any, NamedTuple
|
||||
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.typing import ImageManagerType, KeyEventType, Protocol
|
||||
from kitty.typing_compat import ImageManagerType, KeyEventType, Protocol
|
||||
from kitty.utils import ScreenSize, ScreenSizeGetter, screen_size_function, write_all
|
||||
|
||||
from .handler import Handler
|
||||
|
||||
@@ -11,7 +11,7 @@ from typing import Any, 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_compat import GraphicsCommandType, HandlerType, ScreenSize, UnderlineLiteral
|
||||
|
||||
from .operations_stub import CMD
|
||||
|
||||
@@ -461,7 +461,7 @@ def func_sig(func: Callable[..., Any]) -> Generator[str, None, None]:
|
||||
def as_type_stub() -> str:
|
||||
ans = [
|
||||
'from typing import * # noqa',
|
||||
'from kitty.typing import GraphicsCommandType, ScreenSize',
|
||||
'from kitty.typing_compat import GraphicsCommandType, ScreenSize',
|
||||
'from kitty.fast_data_types import Color',
|
||||
'import kitty.rgb',
|
||||
'import kittens.tui.operations',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
from collections.abc import Sequence
|
||||
|
||||
from kitty.fast_data_types import monotonic
|
||||
from kitty.typing import TypedDict
|
||||
from kitty.typing_compat import TypedDict
|
||||
|
||||
|
||||
class SpinnerDef(TypedDict):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
|
||||
from kitty.typing import BossType
|
||||
from kitty.typing_compat import BossType
|
||||
|
||||
from ..tui.handler import result_handler
|
||||
|
||||
|
||||
Reference in New Issue
Block a user