Start adding typing info
This commit is contained in:
parent
ee48fd7151
commit
64b497589f
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,4 +14,5 @@ __pycache__/
|
||||
/glfw/wayland-*-client-protocol.[ch]
|
||||
/docs/_build/
|
||||
/docs/generated/
|
||||
/.mypy_cache
|
||||
.DS_Store
|
||||
|
||||
@ -145,6 +145,7 @@ def main(sys_args):
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv)
|
||||
elif __name__ == '__doc__':
|
||||
sys.cli_docs['usage'] = usage
|
||||
sys.cli_docs['options'] = OPTIONS
|
||||
sys.cli_docs['help_text'] = help_text
|
||||
cd: dict = sys.cli_docs # type: ignore
|
||||
cd['usage'] = usage
|
||||
cd['options'] = OPTIONS
|
||||
cd['help_text'] = help_text
|
||||
|
||||
50
kitty/fast_data_types.pyi
Normal file
50
kitty/fast_data_types.pyi
Normal file
@ -0,0 +1,50 @@
|
||||
from typing import Callable, Optional, Tuple
|
||||
from kitty.cli import Namespace
|
||||
|
||||
GLFW_IBEAM_CURSOR: int
|
||||
|
||||
|
||||
def create_os_window(
|
||||
get_window_size: Callable[[int, int, int, int, float, float], Tuple[int, int]],
|
||||
pre_show_callback: Callable[[object], None],
|
||||
title: str,
|
||||
wm_class_name: str,
|
||||
wm_class_class: str,
|
||||
load_programs: Optional[Callable[[bool], None]] = None,
|
||||
x: int = -1,
|
||||
y: int = -1
|
||||
) -> int:
|
||||
pass
|
||||
|
||||
|
||||
def set_options(
|
||||
opts: Namespace,
|
||||
is_wayland: bool = False,
|
||||
debug_gl: bool = False,
|
||||
debug_font_fallback: bool = False
|
||||
) -> None:
|
||||
pass
|
||||
|
||||
|
||||
def set_default_window_icon(data: bytes, width: int, height: int) -> None:
|
||||
pass
|
||||
|
||||
|
||||
def set_custom_cursor(cursor_type: int, images: Tuple[Tuple[bytes, int, int], ...], x: int = 0, y: int = 0) -> None:
|
||||
pass
|
||||
|
||||
|
||||
def load_png_data(data: bytes) -> Tuple[bytes, int, int]:
|
||||
pass
|
||||
|
||||
|
||||
def glfw_terminate() -> None:
|
||||
pass
|
||||
|
||||
|
||||
def glfw_init(path: str, debug_keyboard: bool = False) -> bool:
|
||||
pass
|
||||
|
||||
|
||||
def free_font_data() -> None:
|
||||
pass
|
||||
@ -137,7 +137,14 @@ def _run_app(opts, args, bad_lines=()):
|
||||
boss.destroy()
|
||||
|
||||
|
||||
def run_app(opts, args, bad_lines=()):
|
||||
class AppRunner:
|
||||
|
||||
def __init__(self):
|
||||
self.cached_values_name = 'main'
|
||||
self.first_window_callback = lambda window_handle: None
|
||||
self.initial_window_size_func = initial_window_size_func
|
||||
|
||||
def __call__(self, opts, args, bad_lines=()):
|
||||
set_scale(opts.box_drawing_scale)
|
||||
set_options(opts, is_wayland(), args.debug_gl, args.debug_font_fallback)
|
||||
set_font_family(opts, debug_font_matching=args.debug_font_fallback)
|
||||
@ -147,9 +154,7 @@ def run_app(opts, args, bad_lines=()):
|
||||
free_font_data() # must free font data before glfw/freetype/fontconfig/opengl etc are finalized
|
||||
|
||||
|
||||
run_app.cached_values_name = 'main'
|
||||
run_app.first_window_callback = lambda window_handle: None
|
||||
run_app.initial_window_size_func = initial_window_size_func
|
||||
run_app = AppRunner()
|
||||
|
||||
|
||||
def ensure_macos_locale():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user