lib.SSHClient: Move to lib.ec

SSHClient in an ExecContext, hence it's better off in lib.ec, move it
there and adapt the references.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-20 12:53:07 +01:00
commit f37f025b17
3 changed files with 5 additions and 5 deletions

View file

@ -32,7 +32,7 @@ class CmdListRepos(Cmd): # export
match url.scheme:
case 'ssh':
if re.match(r'ssh://.*git\.janware\.com/', args.base_url):
from jw.pkg.lib.SSHClient import ssh_client
from jw.pkg.lib.ec.SSHClient import ssh_client
ssh = ssh_client(args.base_url)
if username is not None:
ssh.set_username(username)

View file

@ -234,7 +234,7 @@ class ExecContext(abc.ABC):
from .ec.Local import Local
return Local(uri, *args, **kwargs)
case 'ssh':
from .SSHClient import ssh_client
from .ec.SSHClient import ssh_client
return ssh_client(uri, *args, **kwargs)
case _:
pass

View file

@ -4,9 +4,9 @@ from typing import Any
import os, abc, shlex, sys
from .util import run_cmd, pretty_cmd
from .log import *
from .ExecContext import ExecContext, Result
from ..util import run_cmd, pretty_cmd
from ..log import *
from ..ExecContext import ExecContext, Result
from urllib.parse import urlparse
class SSHClient(ExecContext):