mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 11:11:47 +02:00
Use a nicer decorator for functions that only need to be run once
This commit is contained in:
@@ -10,7 +10,6 @@ import socket
|
||||
import sys
|
||||
import zlib
|
||||
from base64 import standard_b64encode
|
||||
from functools import lru_cache
|
||||
from math import ceil
|
||||
from tempfile import NamedTemporaryFile
|
||||
from typing import (
|
||||
@@ -21,6 +20,7 @@ from kitty.cli import parse_args
|
||||
from kitty.cli_stub import IcatCLIOptions
|
||||
from kitty.constants import appname
|
||||
from kitty.guess_mime_type import guess_type
|
||||
from kitty.types import run_once
|
||||
from kitty.typing import GRT_f, GRT_t
|
||||
from kitty.utils import (
|
||||
TTYIO, ScreenSize, ScreenSizeGetter, fit_image, screen_size_function
|
||||
@@ -142,7 +142,7 @@ def get_screen_size() -> ScreenSize:
|
||||
return screen_size()
|
||||
|
||||
|
||||
@lru_cache(maxsize=2)
|
||||
@run_once
|
||||
def options_spec() -> str:
|
||||
return OPTIONS.format(appname='{}-icat'.format(appname))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user