Skip to content

Commit

Permalink
Merge pull request #19 from Josh5/dev-unicode
Browse files Browse the repository at this point in the history
Add locale support to the docker container
  • Loading branch information
Josh5 authored Jan 12, 2019
2 parents 16aab11 + 20605bd commit f338ff8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
32 changes: 13 additions & 19 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM josh5/base-ubuntu:16.04
FROM josh5/base-alpine:3.8
LABEL maintainer="Josh.5 <jsunnex@gmail.com>"


Expand All @@ -20,40 +20,34 @@ COPY /requirements.txt /tmp/requirements.txt
### Install pyinotify service.
RUN \
echo "**** Update sources ****" \
&& apt-get update \
&& apk update \
&& \
echo "**** Install python ****" \
&& apt-get install python3 -y --no-install-recommends \
&& apk add --no-cache \
python3 \
&& \
echo "**** Install package build tools ****" \
&& apt-get install -y --no-install-recommends \
${BUILD_DEPENDENCIES} \
&& \
echo "**** Install ffmpeg ****" \
&& apt-get install -y \
&& apk add --no-cache \
ffmpeg \
&& \
echo "**** Install pip packages ****" \
&& python3 -m pip install --no-cache-dir -r /tmp/requirements.txt \
&& \
echo "**** cleanup ****" \
&& apt-get purge -y --auto-remove \
${BUILD_DEPENDENCIES} \
&& apt-get clean \
&& echo rm -rf \
echo "**** Cleanup ****" \
&& rm -rf \
/tmp/* \
/var/tmp/* \
/var/lib/apt/lists/*
/var/tmp/*


### Add local files
COPY /docker/root /
COPY / /app/


### Intended ports and volumes
VOLUME \
/library \
/cache
### Environment variables
ENV \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
LC_CTYPE=en_US.UTF-8 \
LC_ALL=en_US.UTF-8

9 changes: 8 additions & 1 deletion lib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,16 @@ def tail(f, n, offset=0):
return lines
avg_line_length *= 1.3


def touch(fname, mode=0o666, dir_fd=None, **kwargs):
"""Touch a file. If it does not exist, create it."""
flags = os.O_CREAT | os.O_APPEND
with os.fdopen(os.open(fname, flags=flags, mode=mode, dir_fd=dir_fd)) as f:
os.utime(f.fileno() if os.utime in os.supports_fd else fname,
dir_fd=None if os.supports_fd else dir_fd, **kwargs)
dir_fd=None if os.supports_fd else dir_fd, **kwargs)


def test_logging():
logging.info("Check that these characters display correctly")
logging.info("\u251c – € ’ “ ” « » — à á ã ç ê é í ó õ ú")

2 changes: 1 addition & 1 deletion webserver/templates/main-completed-tasks.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{%end%}
</div>
<div class="cont-col2">
<div class="desc"> {{ escape(historical_item['description']) }}
<div class="desc"> {{ historical_item['description'] }}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion webserver/templates/main-pending-tasks.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% for pending_task in handler.getPendingTasks() %}
<li>
<div class="task-title">
<span class="task-title-sp"> {{ escape(pending_task['basename']) }} </span>
<span class="task-title-sp" title="{{ pending_task['abspath'] }}"> {{ pending_task['basename'] }} </span>
<span class="label label-sm label-success">{{ escape(pending_task['video_codecs']) }}</span>
</div>
<div class="task-config">
Expand Down
2 changes: 1 addition & 1 deletion webserver/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
{% for worker_id in range(range_start, range_end) %}
{% try %}
{% set worker_info = all_worker_info[worker_id] %}
<div class="col-md-2 col-sm-4 col-xs-6" id="worker_pie_chart_{{ worker_info['id'] }}" >
<div class="col-md-2 col-sm-4 col-xs-6" id="worker_pie_chart_{{ escape(worker_info['id']) }}" >
<div class="easy-pie-chart worker-pie-chart" >
<div class="number idle" data-percent="100">
<span style="margin-left:-7px;"> - </span>
Expand Down

0 comments on commit f338ff8

Please sign in to comment.