Resource management¶
-
class
protmapper.resources.
Feature
(type, begin, end, name, id, is_main)¶ Bases:
tuple
-
begin
¶ Alias for field number 1
-
end
¶ Alias for field number 2
-
id
¶ Alias for field number 4
-
is_main
¶ Alias for field number 5
-
name
¶ Alias for field number 3
-
type
¶ Alias for field number 0
-
-
class
protmapper.resources.
ResourceManager
(resource_map)[source]¶ Bases:
object
Class to manage a set of resource files.
Parameters: resource_map (dict) – A dict that maps resource file IDs to a tuple of resource file names and download functions. -
download_resource_file
(resource_id, cached=True)[source]¶ Download the resource file corresponding to the given ID.
Parameters:
-
get_create_resource_file
(resource_id, cached=True)[source]¶ Return the path to the resource file, download if it doesn’t exist.
Parameters: Returns: The path to the resource file.
Return type:
-
get_download_fun
(resource_id)[source]¶ Return the download function for the given resource.
Parameters: resource_id (str) – The ID of the resource. Returns: The download function for the given resource. Return type: function
-