-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #455 from memeLab/pymarker-integration
[WIP] 249 Simplify Marker Upload
- Loading branch information
Showing
15 changed files
with
515 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
FROM debian:buster-slim | ||
FROM python:3.9-slim-bullseye | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
python3 \ | ||
python3-pip \ | ||
python3-setuptools \ | ||
gettext \ | ||
docutils-common | ||
COPY ./src/requirements.txt /src/requirements.txt | ||
|
||
RUN pip3 install --upgrade pip | ||
RUN pip3 install --no-cache-dir toolz | ||
RUN pip3 install --no-cache-dir -r /src/requirements.txt | ||
RUN pip install --upgrade pip | ||
RUN pip install --no-cache-dir toolz | ||
RUN pip install --no-cache-dir -r /src/requirements.txt | ||
|
||
RUN rm -rf ~/.cache/pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
from django.contrib.staticfiles.templatetags.staticfiles import static | ||
|
||
from django.core.files.storage import default_storage | ||
|
||
def handle_upload_image(image): | ||
path = "core" + static(f"images/{image.name}") | ||
with open(path, 'wb+') as destination: | ||
for chunk in image.chunks(): | ||
destination.write(chunk) | ||
|
||
def handle_upload_patt(patt): | ||
path = "core" + static(f"patts/{patt.name}") | ||
with default_storage.open(path, 'wb') as destination: | ||
for chunk in patt.chunks(): | ||
destination.write(chunk) | ||
|
||
def handle_upload_marker(image): | ||
path = "core" + static(f"markers/{image.name}") | ||
with open(path, 'wb+') as destination: | ||
for chunk in image.chunks(): | ||
destination.write(chunk) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.