diff --git a/.travis.yml b/.travis.yml index f2cbd0d..e6450cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,45 +1,21 @@ language: python python: - - '2.7' - - '3.2' - - '3.3' - - '3.4' - - '3.5' + - 2.7 + - 3.5 + - 3.6 + - 3.7 + - 3.8 - pypy cache: directories: - $HOME/.cache/pip -sudo: false matrix: fast_finish: true - -addons: - apt: - packages: - - libcurl4-openssl-dev - - python-numpy - - python-opencv - - libopencv-dev - - libjpeg-dev - - libpng-dev - - libx264-dev - - libass-dev - - libvpx1 - - libvpx-dev - - libwebp-dev - - webp - - gifsicle - - python-numpy - - python-scipy - - cython install: - make setup - # Coveralls 4.0 doesn't support Python 3.2 - - if [ "$TRAVIS_PYTHON_VERSION" == "3.2" ]; then travis_retry pip install coverage==3.7.1; fi - pip install coveralls script: make ci_test after_success: coveralls - diff --git a/libthumbor/django/views.py b/libthumbor/django/views.py index ed2dcd6..fe128d5 100644 --- a/libthumbor/django/views.py +++ b/libthumbor/django/views.py @@ -38,14 +38,14 @@ def generate_url(request): try: if 'width' in args: args['width'] = int(args['width']) - except ValueError as e: + except ValueError: error_message = "The width value '%s' is not an integer." % \ args['width'] try: if 'height' in args: args['height'] = int(args['height']) - except ValueError as e: + except ValueError: error_message = "The height value '%s' is not an integer." % \ args['height'] @@ -55,13 +55,13 @@ def generate_url(request): (int(args['crop_left']), int(args['crop_top'])), (int(args['crop_right']), int(args['crop_bottom'])) ) - except KeyError as e: + except KeyError: error_message = ''' Missing values for cropping. Expected all 'crop_left', 'crop_top', 'crop_right', 'crop_bottom' values. ''' - except ValueError as e: + except ValueError: error_message = ''' Invalid values for cropping. Expected all 'crop_left', 'crop_top', diff --git a/libthumbor/url.py b/libthumbor/url.py index 977462d..538abc6 100644 --- a/libthumbor/url.py +++ b/libthumbor/url.py @@ -154,12 +154,12 @@ def get_url_parts(**options): class Url(object): unsafe_or_hash = r'(?:(?:(?Punsafe)|(?P.+?))/)?' - debug = '(?:(?Pdebug)/)?' - meta = '(?:(?Pmeta)/)?' - trim = '(?:(?Ptrim(?::(?:top-left|bottom-right))?(?::\d+)?)/)?' - crop = '(?:(?P\d+)x(?P\d+):(?P\d+)x(?P\d+)/)?' - fit_in = '(?:(?Padaptive-)?(?Pfull-)?(?Pfit-in)/)?' - dimensions = '(?:(?P-)?(?P(?:\d+|orig))?x(?P-)?(?P(?:\d+|orig))?/)?' + debug = r'(?:(?Pdebug)/)?' + meta = r'(?:(?Pmeta)/)?' + trim = r'(?:(?Ptrim(?::(?:top-left|bottom-right))?(?::\d+)?)/)?' + crop = r'(?:(?P\d+)x(?P\d+):(?P\d+)x(?P\d+)/)?' + fit_in = r'(?:(?Padaptive-)?(?Pfull-)?(?Pfit-in)/)?' + dimensions = r'(?:(?P-)?(?P(?:\d+|orig))?x(?P-)?(?P(?:\d+|orig))?/)?' halign = r'(?:(?Pleft|right|center)/)?' valign = r'(?:(?Ptop|bottom|middle)/)?' smart = r'(?:(?Psmart)/)?'