ConsoleUser

Copyright (c) 2010-2023 Skaion Corporarion, www.skaion.com

This project was developed in part by numerous sponsorships from the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints of Governmental purposes notwithstanding any copyright notation thereon.

All content reflects those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the U.S. Government or Skaion Corporation.

class WinSCP.WinSCP(system, config)

This class provides a concrete <no title> implementation that uses `WinSCP`_ in command line mode.

Parameters:

  • system: a <no title> object to communicate with the target system

  • config: a <no title> object hold all our configuration

connect(site, user, passwd)

Connect the scp client to the desired server.

Parameters:

  • site: the name or address of the scp server to connect to

  • user: the username to authenticate with

  • passwd: the password to authenticate with

connect_if_needed(remote)

Given the remote side of the connection, see if we need to do a connect first or not, and do so if needed.

exit(save=False)

Exit the app

Parameters:

  • save: ignored here, accepted to preserve the common function prototype

get(remote, local, wait=True)

Copy the file from the remote location to the local location

handle_overwrite(anchor)

If there is an overwrite prompt make sure it’s below the prompt if there is one, and if so agree to overwrite the file.

Parameters:

  • anchor: The region match that indicates we might need to overwrite

has_error(do_handlers=True)

Find if any known error message is visible, and report it if there is

has_prompt()

Convenience function to see if any prompt is currently available.

is_stopped()

Return whether or not there is no current activity going on.

open()

Launch the winSCP command line client.

put(local, remote, wait=True)

Copy the file from the local location to the remote location