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 P2PImpl.P2PImpl(system, config)¶
This class is the public interface by which a <no title> can use a P2P client.
Parameters:
system: a <no title> object to communicate with the target system
config: a <no title> object hold all our configuration
- ptype: optionally the (string) name of the type of CommandShell
to create, overriding anything in the config object
- add_file(path, urls)¶
Add a new file to the list that this client is offering up, and announce its availability at the list of urls.
Parameters:
- path: a string containing the path on the client machine to
the file to share
- urls: when applicable, use this iterable of strings of URLs
to announce the availability
- get_file(path, local_dir='')¶
Get the given file to our machine.
Parameters:
path: the string identifier by which the remote file is known
- local_dir: the string path to the local directory into
which the file should be saved, or empty to accept the default
- P2PImpl.get_p2p_client(system, config, ptype=None)¶
This is a Factory function which will instantiate the correct P2PImpl subclass give then config or browser type specified.
Parameters:
system: a <no title> object which lets us control the remote system
config: a <no title> object defining the current user
ptype: optionally a P2P type to override the default from config