Overview¶
Path | PyPoE/poe/file/shared/cache.py |
Version | 1.0.0a0 |
Revision | $Id: 5ea9fe7986eed9718fcd927eaa1d8ec1498edb24 $ |
Author | Omega_K2 |
Description¶
All file caches classes will inherit AbstractFileCache
.
Warning
None of the abstract classes found here should be instantiated directly.
See also:
Agreement¶
See PyPoE/LICENSE
Documentation¶
Bases:
PyPoE.shared.mixins.ReprMixin
Variables: - '_ggpk' (GGPKFile) –
- '_path' (str) –
- 'files' (dict[str, AbstractFileReadOnly]) – Dictionary of loaded file instances and their related path
Parameters: - path_or_ggpk (str | GGPKFile) – The root path (i.e. relative to content.ggpk) where the files are
stored or a
PyPoE.poe.file.ggpk.GGPKFile
instance - files (Iterable) – Iterable of files that will be loaded right away
- files_shortcut (bool) – Whether to use the shortcut function, i.e. self.__getitem__
- instance_options (dict[str, object]) – options to pass to the file’s __init__ method
- read_options (dict[str, object]) – options to pass to the file instance’s read method
Raises: TypeError
– if path_or_ggpk not specified or invalid typeValueError
– if aPyPoE.poe.file.ggpk.GGPKFile
was passed, but it was not parsed
- path_or_ggpk (str | GGPKFile) – The root path (i.e. relative to content.ggpk) where the files are
stored or a
Creates a new instance for the given file name
Parameters: file_name (str) – Name to the file to pass on Returns: Return type: File instance
Returns a dictionary of keyword arguments to pass to the file’s __init__ method upon initial reading.
Parameters: file_name (str) – Name of the file Returns: Dictionary of keyword arguments Return type: dict[str, object]
Returns a dictionary of keyword arguments to pass to the file’s read method upon initial reading.
In particular it sets file_path_or_raw based on how the cache was instantiated.
Parameters: file_name (str) – Name of the file Returns: Dictionary of keyword arguments Return type: dict[str, object]
Returns the the specified file from the cache.
If the file does not exist, read it from the path specified on cache creation, add it to the cache and then return it.
Parameters: file_name (str) – File to retrieve Returns: read file instance Return type: AbstractFileReadOnly
The path or
PyPoE.poe.file.ggpk.GGPKFile
instance the cache was created with