slidge.core.cache#

Module Contents#

Classes#

Attributes#

class slidge.core.cache.CachedAvatar[source]#
property data[source]#
property path[source]#
filename: str[source]#
hash: str[source]#
height: int[source]#
width: int[source]#
root: pathlib.Path[source]#
etag: str | None[source]#
last_modified: str | None[source]#
class slidge.core.cache.AvatarCache[source]#
_shelf: shelve.Shelf[CachedAvatar][source]#
dir: pathlib.Path[source]#
set_dir(path)[source]#
Parameters:

path (pathlib.Path) –

close()[source]#
async get_avatar_from_url_alone(url)[source]#

Used when no avatar unique ID is passed. Store and use http headers to avoid fetching ut

Parameters:

url (str) –

get(unique_id)[source]#
Parameters:

unique_id (str) –

convert_and_store(img, unique_id, response_headers=None)[source]#
Parameters:
  • img (PIL.Image.Image) –

  • unique_id (str) –

  • response_headers (Optional[multidict.CIMultiDictProxy[str]]) –

slidge.core.cache.avatar_cache[source]#
slidge.core.cache.log[source]#