We dont need a special class for delete_env_var
This commit is contained in:
parent
66e2e60ac4
commit
5b716df45f
@ -13,7 +13,7 @@ from typing import (
|
|||||||
|
|
||||||
import kitty.fast_data_types as fast_data_types
|
import kitty.fast_data_types as fast_data_types
|
||||||
|
|
||||||
from .constants import is_macos, shell_path, terminfo_dir, delete_env_var
|
from .constants import is_macos, shell_path, terminfo_dir
|
||||||
from .types import run_once
|
from .types import run_once
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -209,6 +209,7 @@ class Child:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def final_env(self) -> Dict[str, str]:
|
def final_env(self) -> Dict[str, str]:
|
||||||
|
from kitty.options.utils import delete_env_var
|
||||||
env: Optional[Dict[str, str]] = getattr(self, '_final_env', None)
|
env: Optional[Dict[str, str]] = getattr(self, '_final_env', None)
|
||||||
if env is None:
|
if env is None:
|
||||||
env = self._final_env = default_env().copy()
|
env = self._final_env = default_env().copy()
|
||||||
|
|||||||
@ -21,18 +21,10 @@ class Version(NamedTuple):
|
|||||||
patch: int
|
patch: int
|
||||||
|
|
||||||
|
|
||||||
class SentinelString(str):
|
|
||||||
|
|
||||||
def __new__(cls, val: str) -> 'SentinelString':
|
|
||||||
ans: SentinelString = str.__new__(cls, val)
|
|
||||||
return ans
|
|
||||||
|
|
||||||
|
|
||||||
appname: str = 'kitty'
|
appname: str = 'kitty'
|
||||||
kitty_face = '🐱'
|
kitty_face = '🐱'
|
||||||
version: Version = Version(0, 23, 1)
|
version: Version = Version(0, 23, 1)
|
||||||
str_version: str = '.'.join(map(str, version))
|
str_version: str = '.'.join(map(str, version))
|
||||||
delete_env_var = SentinelString('_delete_this_env_var_')
|
|
||||||
_plat = sys.platform.lower()
|
_plat = sys.platform.lower()
|
||||||
is_macos: bool = 'darwin' in _plat
|
is_macos: bool = 'darwin' in _plat
|
||||||
if getattr(sys, 'frozen', False):
|
if getattr(sys, 'frozen', False):
|
||||||
|
|||||||
@ -16,7 +16,7 @@ from kitty.conf.utils import (
|
|||||||
KeyAction, key_func, positive_float, positive_int, python_string, to_bool,
|
KeyAction, key_func, positive_float, positive_int, python_string, to_bool,
|
||||||
to_cmdline, to_color, uniq, unit_float
|
to_cmdline, to_color, uniq, unit_float
|
||||||
)
|
)
|
||||||
from kitty.constants import config_dir, is_macos, delete_env_var
|
from kitty.constants import config_dir, is_macos
|
||||||
from kitty.fast_data_types import CURSOR_BEAM, CURSOR_BLOCK, CURSOR_UNDERLINE
|
from kitty.fast_data_types import CURSOR_BEAM, CURSOR_BLOCK, CURSOR_UNDERLINE
|
||||||
from kitty.fonts import FontFeature
|
from kitty.fonts import FontFeature
|
||||||
from kitty.key_names import (
|
from kitty.key_names import (
|
||||||
@ -42,6 +42,7 @@ for x in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
|
|||||||
sequence_sep = '>'
|
sequence_sep = '>'
|
||||||
func_with_args, args_funcs = key_func()
|
func_with_args, args_funcs = key_func()
|
||||||
FuncArgsType = Tuple[str, Sequence[Any]]
|
FuncArgsType = Tuple[str, Sequence[Any]]
|
||||||
|
delete_env_var = '_delete_this_env_var_'
|
||||||
|
|
||||||
|
|
||||||
class InvalidMods(ValueError):
|
class InvalidMods(ValueError):
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
from . import BaseTest
|
from . import BaseTest
|
||||||
from kitty.utils import log_error
|
from kitty.utils import log_error
|
||||||
from kitty.constants import delete_env_var
|
from kitty.options.utils import delete_env_var
|
||||||
|
|
||||||
|
|
||||||
class TestConfParsing(BaseTest):
|
class TestConfParsing(BaseTest):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user