Move class definition to utils so can be used from multiple kittens easily

This commit is contained in:
Kovid Goyal
2020-09-15 10:34:37 +05:30
parent 0a027fad9a
commit be29c4a243
3 changed files with 10 additions and 9 deletions

View File

@@ -8,7 +8,9 @@ import shlex
import subprocess
import sys
from contextlib import suppress
from typing import List, NamedTuple, NoReturn, Optional, Set, Tuple
from typing import List, NoReturn, Optional, Set, Tuple
from kitty.utils import SSHConnectionData
SHELL_SCRIPT = '''\
#!/bin/sh
@@ -61,12 +63,6 @@ def get_ssh_cli() -> Tuple[Set[str], Set[str]]:
return set('-' + x for x in boolean_ssh_args), set('-' + x for x in other_ssh_args)
class SSHConnectionData(NamedTuple):
binary: str
hostname: str
port: Optional[int] = None
def get_connection_data(args: List[str]) -> Optional[SSHConnectionData]:
boolean_ssh_args, other_ssh_args = get_ssh_cli()
found_ssh = ''