Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
Return a list of paths to all sizes of thumbs for a given item.

:param item: A 2-tuple with a subdir name and an ID. If given a
    ORM mapped class with _thumb_dir and id attributes, the info
    can be extracted automatically.
:type item: ``tuple`` or mapped class instance
:returns: thumb sizes and their paths
:rtype: ``dict``

        def thumb_paths(item, **kwargs):
    """Return a list of paths to all sizes of thumbs for a given item.

    :param item: A 2-tuple with a subdir name and an ID. If given a
        ORM mapped class with _thumb_dir and id attributes, the info
        can be extracted automatically.
    :type item: ``tuple`` or mapped class instance
    :returns: thumb sizes and their paths
    :rtype: ``dict``

    """
    image_dir, item_id = _normalize_thumb_item(item)
    paths = dict((key, thumb_path(item, key, **kwargs))
                 for key in config['thumb_sizes'][image_dir].iterkeys())
    # We can only find the original image but examining the file system,
    # so only return it if exists is True.
    if kwargs.get('exists', False):
        for extname in ('jpg', 'png'):
            path = thumb_path(item, 'orig', **kwargs)
            if path:
                paths['orig'] = path
                break
    return paths
        


src/m/e/mediadrop-HEAD/mediadrop/controllers/admin/media.py   mediadrop(Download)
from mediadrop.lib.storage import add_new_media_file
from mediadrop.lib.templating import render
from mediadrop.lib.thumbnails import thumb_path, thumb_paths, create_thumbs_for, create_default_thumbs_for, has_thumbs, has_default_thumbs, delete_thumbs
from mediadrop.model import (Author, Category, Media, Podcast, Tag, fetch_row,
    get_available_slug, slugify)