Skip to content

Commit

Permalink
Merge branch 'pr/5'
Browse files Browse the repository at this point in the history
  • Loading branch information
stephrdev committed May 4, 2016
2 parents 94dca89 + 35547e1 commit 82e1014
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ python:
- "3.4"

env:
- DJANGO_VERSION=1.9.x
- DJANGO_VERSION=1.8.x
- DJANGO_VERSION=1.7.x
- DJANGO_VERSION=1.6.x
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def read(*parts):
test_suite='.',
tests_require=tests_require,
install_requires=[
'Django>=1.6,<1.9',
'barbeque>=0.2.1,<0.4.0',
'Django>=1.6,<1.10',
'barbeque>=0.2.1,<1.1.0',
'Pillow',
],
extras_require={
Expand Down
12 changes: 12 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dependencies17 =
https://github.com/django/django/archive/stable/1.7.x.tar.gz#egg=django
dependencies18 =
https://github.com/django/django/archive/stable/1.8.x.tar.gz#egg=django
dependencies19 =
https://github.com/django/django/archive/stable/1.9.x.tar.gz#egg=django

[testenv:2.7-1.6.x]
basepython = python2.7
Expand All @@ -26,6 +28,11 @@ basepython = python2.7
deps =
{[testenv]dependencies18}

[testenv:2.7-1.9.x]
basepython = python2.7
deps =
{[testenv]dependencies19}

[testenv:3.4-1.6.x]
basepython = python3.4
deps =
Expand All @@ -41,6 +48,11 @@ basepython = python3.4
deps =
{[testenv]dependencies18}

[testenv:3.4-1.9.x]
basepython = python3.4
deps =
{[testenv]dependencies19}

[testenv:docs]
commands =
pip install -e {toxinidir}[docs]
Expand Down
5 changes: 2 additions & 3 deletions ultimatethumb/thumbnail.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import os
from collections import namedtuple
from collections import OrderedDict, namedtuple

from barbeque.commands.imaging import GmConvertCommand
from barbeque.files import MoveableNamedTemporaryFile
from django.conf import settings
from django.utils.datastructures import SortedDict

from .commands import PngquantCommand
from .storage import thumbnail_storage
Expand Down Expand Up @@ -148,7 +147,7 @@ def generate(self, factor=1):
return True

def get_gm_options(self, factor=1):
gm_options = SortedDict()
gm_options = OrderedDict()

# Remove any icc profiles to avoid problems.
gm_options['+profile'] = '"*"'
Expand Down
7 changes: 3 additions & 4 deletions ultimatethumb/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import json
import os
import re
from collections import OrderedDict

from django.conf import settings
from django.contrib.staticfiles.finders import find
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.cache import cache
from django.core.files.storage import default_storage
from django.core.urlresolvers import reverse
from django.utils.datastructures import SortedDict
from django.utils.encoding import force_bytes
from django.utils.six.moves.urllib import parse as urlparse
from PIL import Image as PILImage
Expand All @@ -27,10 +27,9 @@ def get_cache_key(key):

def get_thumb_name(source, **options):
source_name, source_ext = os.path.splitext(os.path.basename(source))
data = SortedDict()
data = OrderedDict()
data['source'] = source
data['opts'] = SortedDict(options)
data['opts'].keyOrder = sorted(data['opts'].keyOrder)
data['opts'] = OrderedDict(sorted(options.items(), key=lambda i: i[0]))

serialized_data = json.dumps(data)
hashed_data = hashlib.sha1(force_bytes(serialized_data)).hexdigest()
Expand Down

0 comments on commit 82e1014

Please sign in to comment.