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
|
||||
|
||||
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
|
||||
|
||||
try:
|
||||
@ -209,6 +209,7 @@ class Child:
|
||||
|
||||
@property
|
||||
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)
|
||||
if env is None:
|
||||
env = self._final_env = default_env().copy()
|
||||
|
||||
@ -21,18 +21,10 @@ class Version(NamedTuple):
|
||||
patch: int
|
||||
|
||||
|
||||
class SentinelString(str):
|
||||
|
||||
def __new__(cls, val: str) -> 'SentinelString':
|
||||
ans: SentinelString = str.__new__(cls, val)
|
||||
return ans
|
||||
|
||||
|
||||
appname: str = 'kitty'
|
||||
kitty_face = '🐱'
|
||||
version: Version = Version(0, 23, 1)
|
||||
str_version: str = '.'.join(map(str, version))
|
||||
delete_env_var = SentinelString('_delete_this_env_var_')
|
||||
_plat = sys.platform.lower()
|
||||
is_macos: bool = 'darwin' in _plat
|
||||
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,
|
||||
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.fonts import FontFeature
|
||||
from kitty.key_names import (
|
||||
@ -42,6 +42,7 @@ for x in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
|
||||
sequence_sep = '>'
|
||||
func_with_args, args_funcs = key_func()
|
||||
FuncArgsType = Tuple[str, Sequence[Any]]
|
||||
delete_env_var = '_delete_this_env_var_'
|
||||
|
||||
|
||||
class InvalidMods(ValueError):
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
from . import BaseTest
|
||||
from kitty.utils import log_error
|
||||
from kitty.constants import delete_env_var
|
||||
from kitty.options.utils import delete_env_var
|
||||
|
||||
|
||||
class TestConfParsing(BaseTest):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user