IDownloadManager

class mobase.IDownloadManager

Bases: object

Methods Summary

downloadPath(id)

Retrieve the (absolute) path of the specified download.

onDownloadComplete(callback)

Installs a handler to be called when a download completes.

onDownloadFailed(callback)

Installs a handler to be called when a download fails.

onDownloadPaused(callback)

Installs a handler to be called when a download is paused.

onDownloadRemoved(callback)

Installs a handler to be called when a download is removed.

startDownloadNexusFile(mod_id, file_id)

Download a file from www.nexusmods.com/<game>.

startDownloadURLs(urls)

Download a file by url.

Methods Documentation

downloadPath(id)

Retrieve the (absolute) path of the specified download.

Parameters

id – ID of the download.

Returns

The absolute path to the file corresponding to the given download. This file

may not exist yet if the download is incomplete.

Return type

str

onDownloadComplete(callback)

Installs a handler to be called when a download completes.

Parameters

callback – The function to be called when a download complete. The parameter is the download ID.

Returns

True if the handler was installed properly (there are currently no reasons for this to fail).

Return type

bool

onDownloadFailed(callback)

Installs a handler to be called when a download fails.

Parameters

callback – The function to be called when a download fails. The parameter is the download ID.

Returns

True if the handler was installed properly (there are currently no reasons for this to fail).

Return type

bool

onDownloadPaused(callback)

Installs a handler to be called when a download is paused.

Parameters

callback – The function to be called when a download is paused. The parameter is the download ID.

Returns

True if the handler was installed properly (there are currently no reasons for this to fail).

Return type

bool

onDownloadRemoved(callback)

Installs a handler to be called when a download is removed.

Parameters

callback – The function to be called when a download is removed. The parameter is the download ID.

Returns

True if the handler was installed properly (there are currently no reasons for this to fail).

Return type

bool

startDownloadNexusFile(mod_id, file_id)

Download a file from www.nexusmods.com/<game>. <game> is always the game currently being managed.

Parameters
  • mod_id – ID of the mod to download the file from.

  • file_id – ID of the file to download.

Returns

An ID identifying the download.

Return type

int

startDownloadURLs(urls)

Download a file by url.

The list can contain alternative URLs to allow the download manager to switch in case of download problems

Parameters

urls – List of urls to download from.

Returns

An ID identifying the download.

Return type

int