Skip to content
This repository was archived by the owner on Apr 16, 2023. It is now read-only.

Commit 9e3ec64

Browse files
Patrick KuehnPatrick Kuehn
authored andcommitted
Merge branch 'dev' into predict-app
2 parents 74ed977 + 555758e commit 9e3ec64

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

.github/pull_request_template.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Feel free to open a PR before all of these items have been completed.
22

33
Pull Request Checklist
4+
- [ ] Pull request has been made against `dev` branch.
45
- [ ] Pull request includes a description of the change and the reason behind it.
56
- [ ] Pull request [uses keywords](https://help.github.com/en/articles/closing-issues-using-keywords) to close relevant [issues](https://github.com/uptake/autofocus/issues).
67
- [ ] Pull request includes unit tests for any new functionality.
@@ -11,4 +12,4 @@ Maintainer's responsibilities:
1112
- [ ] `_version.py` has been updated.
1213
- [ ] `CHANGELOG.md` has been updated.
1314
- [ ] Updated app container has been pushed, if relevant, with current version number.
14-
- [ ] App container version number has been updated in README.
15+
- [ ] App container version number has been updated everywhere in README.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
55

6+
# [1.2.4] - 2019-10-13
7+
### Changed
8+
- Service gets image file extensions from `mimetypes` instead of using a hard-coded list.
9+
610
# [1.2.3] - 2019-8-22
711
### Changed
812
- Tests and instructions now refer to "localhost" instead of "0.0.0.0".

autofocus/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.2.2"
1+
__version__ = "1.2.4"

autofocus/predict/app/requests/Validator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
import mimetypes
12
from abc import ABC, abstractmethod
23

34
from flask import abort, jsonify, make_response
45
from flask_api import status
56

67

7-
ALLOWED_IMAGE_FILES = set(["png", "jpg", "jpeg", "gif", "bmp"])
8-
ALLOWED_ZIP_FILES = {"zip"}
8+
ALLOWED_IMAGE_FILES = set(
9+
k for k, v in mimetypes.types_map.items() if v.startswith("image/")
10+
)
11+
ALLOWED_ZIP_FILES = {".zip"}
912

1013

1114
class Validator(ABC):

autofocus/predict/app/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ def allowed_file(filename, allowed_extensions):
1111
bool: whether the filename is in allowed extensions
1212
1313
"""
14-
return Path(filename).suffix.lower().replace(".", "") in allowed_extensions
14+
return Path(filename).suffix.lower() in allowed_extensions

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
extras_require={"dev": regular_packages + dev_packages},
3232
author="Greg Gandenberger",
3333
author_email="[email protected]",
34-
url="https://github.com/UptakeOpenSource/autofocus",
34+
url="https://github.com/uptake/autofocus",
3535
long_description_content_type="text/markdown",
3636
)

0 commit comments

Comments
 (0)