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

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)
Return True if the thumbs for the given item are the defaults.

: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

        def has_default_thumbs(item):
    """Return True if the thumbs for the given item are the defaults.

    :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
    """
    image_dir, item_id = _normalize_thumb_item(item)
    return filecmp.cmp(thumb_path((image_dir, item_id), 's'),
                       thumb_path((image_dir, 'new'), 's'))
        


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)
        # Copy the input thumb over the default thumbnail
        elif input.slug.startswith('_stub_') \
        and has_default_thumbs(orig) \
        and not has_default_thumbs(input):
            for key, dst_path in thumb_paths(orig).iteritems():

src/m/e/mediadrop-HEAD/mediadrop/lib/storage/api.py   mediadrop(Download)
from mediadrop.lib.filetypes import guess_container_format, guess_media_type
from mediadrop.lib.i18n import _
from mediadrop.lib.thumbnails import (create_thumbs_for, has_thumbs,
    has_default_thumbs)
from mediadrop.lib.xhtml import clean_xhtml
 
    if ('thumbnail_url' in meta or 'thumbnail_file' in meta) \
    and (not has_thumbs(media) or has_default_thumbs(media)):
        thumb_file = meta.get('thumbnail_file', None)