OreSat File Cache
- class olaf.OreSatFileCache(dir_path: str)[source]
File cache for OreSat files (by use of
OresatFile). Thread safe.- Parameters:
dir_path (str) – Directory to use as a OreSat file cache. Directory will be made if it does not exist.
- add(file_path: str, consume: bool = False)[source]
Add file to cache
- Parameters:
- Raises:
FileNotFoundError – file_path was not a valid file path
- remove(file_name: str)[source]
Remove a file from cache
- Parameters:
file_name (str) – Name of the file to remove from the cache
- peek() str[source]
Get the oldest file name
- Returns:
Name of the oldest file or an empty string if the cache is empty.
- Return type:
- get(file_name: str, dir_path: str, copy: bool = False) str[source]
Get the file from the cache and move it a specific directory.
- Parameters:
- Raises:
FileNotFoundError – file_name was not in cache
- Returns:
File path of the file now in dir_path or an empty string if the cache is empty.
- Return type:
- files(keyword: str = '') list[OreSatFile][source]
Return a list of files in the cache.
- Parameters:
keyword (str) – A keyword to filter by
- Returns:
list of
OreSatFilethat are in the cache.- Return type: