def handle_remote_file(self, netloc: str, remote_path: str) -> None: from kittens.ssh.main import get_connection_data args = self.child.foreground_cmdline conn_data = get_connection_data(args) if conn_data is None: get_boss().show_error('Could not handle remote file', 'No SSH connection data found in: {args}') return get_boss().run_kitten('remote_file', '--hostname', netloc.partition(':')[0], '--path', remote_path, '--ssh-connection-data', json.dumps(conn_data))
def t(cmdline, binary='ssh', host='main', port=None, identity_file='', extra_args=()): if identity_file: identity_file = os.path.abspath(identity_file) en = set(f'{x[0]}' for x in extra_args) q = get_connection_data(cmdline.split(), extra_args=en) self.ae( q, SSHConnectionData(binary, host, port, identity_file, extra_args))
def t(cmdline, binary='ssh', host='main', port=None, identity_file=''): if identity_file: identity_file = os.path.abspath(identity_file) q = get_connection_data(cmdline.split()) self.ae(q, SSHConnectionData(binary, host, port, identity_file))