Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial work on python 3 support

  • Loading branch information...
commit 1e76d9a25695fb817b57679e9963bde4748988f9 1 parent c2a660a
@anrie anrie authored
View
1  .gitignore
@@ -1,6 +1,7 @@
*.pyc
*.sqlite3
*~
+*.bak
*.swp
*.egg-info*
build/
View
4 example/requirements.txt
@@ -1,2 +1,2 @@
-django==1.4.5
-
+django==1.6
+easy_thumbnails=1.4
View
1  example/templates/navigation.html
@@ -1,3 +1,4 @@
+{% load url from future %}
<ul id="navigation">
<li><a href="{% url 'thumbnail_options' %}">Thumbnail cropping options</a></li>
<li><a href="{% url 'thumbnail_foreign_key' %}">CropForeignKey example</a></li>
View
2  image_cropping/__init__.py
@@ -2,4 +2,4 @@
from .admin import ImageCroppingMixin
from .widgets import ImageCropWidget
-__version__ = '0.7.1'
+__version__ = '0.8'
View
1  image_cropping/admin.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from . import widgets
View
1  image_cropping/fields.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import warnings
from django.db import models
from django import forms
View
3  image_cropping/thumbnail_processors.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import logging
@@ -16,7 +17,7 @@ def crop_corners(image, box=None, **kwargs):
if not isinstance(box, (list, tuple)):
# convert cropping string to a list of integers if necessary
try:
- box = map(int, box.split(','))
+ box = list(map(int, box.split(',')))
except ValueError:
# there's garbage in the cropping field, ignore
logger.warning(
View
1  image_cropping/widgets.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import logging
import inspect
import warnings
View
13 setup.py
@@ -1,12 +1,13 @@
import re
import os
import codecs
-from distutils.core import setup
-from setuptools import find_packages
+from setuptools import setup, find_packages
def read(*parts):
- return codecs.open(os.path.join(os.path.dirname(__file__), *parts)).read()
+ filename = os.path.join(os.path.dirname(__file__), *parts)
+ with codecs.open(filename, encoding='utf-8') as fp:
+ return fp.read()
def find_version(*file_paths):
@@ -18,7 +19,8 @@ def find_version(*file_paths):
raise RuntimeError("Unable to find version string.")
-setup(name="django-image-cropping",
+setup(
+ name="django-image-cropping",
version=find_version("image_cropping", "__init__.py"),
description="A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
@@ -36,5 +38,8 @@ def find_version(*file_paths):
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.3',
],
)
Please sign in to comment.
Something went wrong with that request. Please try again.