class documentation

class ThumbnailManager(object): (source)

View In Hierarchy

This class implements thumbnails management (mostly) following the freedesktop.org spec.
Method __init__ Undocumented
Method create_thumbnail No summary
Method get_thumbnail No summary
Method get_thumbnail_file No summary
Method remove_thumbnails No summary
Instance Variable _thumbnailcreator Undocumented
def __init__(self, thumbnailcreator=pixbufThumbnailCreator): (source)

Undocumented

def create_thumbnail(self, file, size): (source)
(Re-)create a thumbnail without any checking whether the old one is still valid.
Parameters
filethe file to be thumbnailed as File object
sizepixel size for thumbnail file as integer
Returns
a 2-tuple of the thumbnail file and a pixbuf object
Raises
ThumbnailCreatorFailureif creation fails unexpectedly
def get_thumbnail(self, file, size, create=True): (source)
Looksup thumbnail and return it if a valid thumbnail is availabel.
Parameters
filethe file to be thumbnailed as File object
sizepixel size for thumbnail image as integer
createif True we try to create the thumbnail if it doesn't exist
Returns
a 2-tuple of the thumbnail file and a pixbuf object or 2 times None
def get_thumbnail_file(self, file, size): (source)
Get File object for thumbnail Does not guarantee that the thumbnail actually exists. Do not use this method to lookup the thumbnail, use get_thumbnail() instead.
Parameters
filethe original file to be thumbnailed
sizethumbnail size in pixels (THUMB_SIZE_NORMAL, THUMB_SIZE_LARGE, or integer)
Returns
a File object
def remove_thumbnails(self, file): (source)
Remove thumbnails for at all sizes To be used when thumbnails are outdated, e.g. when the original file is removed or updated.
Parameters
filethe original file
_thumbnailcreator = (source)

Undocumented