unidown.core¶
unidown.core.manager¶
Manager of the whole program, contains the most important functions as well as the download routine.
-
unidown.core.manager.download_from_plugin(plugin)[source]¶ Download routine.
Get plugin from the given name
Get the last overall update time
Load the savestate
Compare last update time with the one from the savestate
Get the download links
Compare received links and their times with the savestate
Clean up names, to eliminate duplicated
Download new and newer links
Check downloaded data
Update savestate
Save new savestate to file
- Parameters
plugin (
APlugin) – plugin
-
unidown.core.manager.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.
-
unidown.core.manager.init_logging(settings)[source]¶ Initialize the _downloader.
- Parameters
settings (
Settings) – settings
unidown.core.plugin_state¶
-
class
unidown.core.plugin_state.PluginState(value)[source]¶ State of a plugin, after it ended or was not found.
-
EndSuccess= 0¶ successfully end
-
LoadCrash= 3¶ raised an exception while loading/ initializing
-
NotFound= 4¶ plugin was not found
-
RunCrash= 2¶ raised an exception but ~unidown.plugin.exceptions.PluginException
-
RunFail= 1¶ raised an ~unidown.plugin.exceptions.PluginException
-
unidown.core.settings¶
-
class
unidown.core.settings.Settings(root_dir=None, log_file=None, log_level='INFO')[source]¶ - Variables
_root_dir – root path
temp_dir – temporary main path, here are the sub folders for every plugin
download_dir – download main path, here are the sub folders for every plugin
savestate_dir – savestates main path, here are the sub folders for every plugin
log_file – log file of the program
available_plugins – available plugins which are found at starting the program, name -> EntryPoint
using_cores – how many _cores should be used
_log_level – log level
_disable_tqdm – if the console progress bar is disabled
- Parameters
-
check_dirs()[source]¶ Check the directories if they exist.
- Raises
FileExistsError – if a file exists but is not a directory