qitoolchain.remote – Network operations

Set of tools to perform remote operations, downloading package or reading configs from URLs

qitoolchain.remote.authenticated_urlopen(location)

A wrapper around urlopen adding authentication information if provided by the user.

qitoolchain.remote.callback(total, done)

Called during download

qitoolchain.remote.download(url, output_dir, output_name=None, callback=<function callback at 0x461db18>, clobber=True, message=None)

Download a file from an url, and save it in output_dir.

Parameters:
  • output_name – The name of the file will be the basename of the url, unless output_name is given
  • callback – callback to use to show download progress. By default qitoolchain.remote.callback() is called
  • message – a message to print right before displaying progress bar.
  • clobber – If False, the file won’t be overwritten if it already exists (True by default)
Returns:

the path to the downloaded file

qitoolchain.remote.get_ftp_access(server_name)

Get ftp password from the config file

Parameters:server – A server node in the global qibuild xml configuration file
Returns:A qibuild.config.Access instance
qitoolchain.remote.get_server_access(server_name)

Get server access for a remote site.

Parameters:server – A server node in the global qibuild xml configuration file
Returns:A qibuild.config.Access instance
qitoolchain.remote.open_remote_location(location)

Open a file from an url

Returns:a file-like object