示例#1
0
    Library, Node, VariableDoesNotExist, TemplateSyntaxError)
from django.utils.html import escape

from easy_thumbnails import utils
from easy_thumbnails.alias import aliases
from easy_thumbnails.conf import settings
from easy_thumbnails.files import get_thumbnailer

import logging
logger = logging.getLogger(__file__)

register = Library()

RE_SIZE = re.compile(r'(\d+)x(\d+)$')

VALID_OPTIONS = utils.valid_processor_options()
VALID_OPTIONS.remove('size')


def split_args(args):
    """
    Split a list of argument strings into a dictionary where each key is an
    argument name.

    An argument looks like ``crop``, ``crop="some option"`` or ``crop=my_var``.
    Arguments which provide no value get a value of ``True``.
    """
    args_dict = {}
    for arg in args:
        split_arg = arg.split('=', 1)
        if len(split_arg) > 1:
示例#2
0
 def get_valid_thumbnail_options():
     options = utils.valid_processor_options()
     options.remove('size')
     return options
示例#3
0
from django.template import Library, Node, VariableDoesNotExist, \
    TemplateSyntaxError
from easy_thumbnails import utils
from easy_thumbnails.files import get_thumbnailer
from django.utils.html import escape
import re

register = Library()

RE_SIZE = re.compile(r'(\d+)x(\d+)$')

VALID_OPTIONS = utils.valid_processor_options()
VALID_OPTIONS.remove('size')


def split_args(args):
    """
    Split a list of argument strings into a dictionary where each key is an
    argument name.

    An argument looks like ``crop``, ``crop="some option"`` or ``crop=my_var``.
    Arguments which provide no value get a value of ``True``.

    """
    args_dict = {}
    for arg in args:
        split_arg = arg.split('=', 1)
        if len(split_arg) > 1:
            value = split_arg[1]
        else:
            value = True
示例#4
0
 def get_valid_thumbnail_options():
     options = utils.valid_processor_options()
     options.remove('size')
     return options