unidown.core.manager

Manager of the whole program, contains the most important functions as well as the download routine.

Functions

check_update()

Check for app updates and print/log them.

download_from_plugin(plugin)

Download routine.

get_options(options)

Convert the option list to a dictionary where the key is the option and the value is the related option.

init_logging(settings)

Initialize the _downloader.

run(settings, plugin_name, raw_options)

Run a plugin so use the download routine and clean up after.

shutdown()

Close and exit important things.

check_update()[source]

Check for app updates and print/log them.

Return type

None

download_from_plugin(plugin)[source]

Download routine.

  1. Get plugin from the given name

  2. Get the last overall update time

  3. Load the savestate

  4. Compare last update time with the one from the savestate

  5. Get the download links

  6. Compare received links and their times with the savestate

  7. Clean up names, to eliminate duplicated

  8. Download new and newer links

  9. Check downloaded data

  10. Update savestate

  11. Save new savestate to file

Parameters

plugin (APlugin) – Plugin.

Return type

None

get_options(options)[source]

Convert the option list to a dictionary where the key is the option and the value is the related option. Is called in the init.

Parameters

options (list[list[str]]) – Options given to the plugin.

Return type

dict[str, Any]

Returns

Dictionary which contains the option key and values.

init_logging(settings)[source]

Initialize the _downloader.

Parameters

settings (Settings) – Settings.

Return type

None

run(settings, plugin_name, raw_options)[source]

Run a plugin so use the download routine and clean up after.

Parameters
  • settings (Settings) – Settings to use.

  • plugin_name (str) – Name of plugin.

  • raw_options (list[list[str]]) – Parameters which will be sent to the plugin initialization.

Return type

PluginState

Returns

Ending state.

shutdown()[source]

Close and exit important things.

Return type

None