From 4c315e2f9a7d8e2df1c7afaf1499f94046a85a60 Mon Sep 17 00:00:00 2001 From: traBpUkciP Date: Thu, 18 Nov 2021 23:58:42 -0400 Subject: [PATCH 1/5] housekeeping --- .gitignore | 18 +++++------------- .vscode/settings.json | 7 +++++++ 2 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 0ecfc76..6580108 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,13 @@ -.vscode/* -build/* -dist/* -testenv/* -testenv2/* +build +dist venv/* venv35/* venv36/* -xmas_app/* +*-docker.zip *.pyc *.pyo -*.ico -installer.cfg -YuleLog.egg-info/* - -manage.py - -yule_log/__pycache__/* +YuleLog.egg-info +yule_log/__pycache__ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1b67bf7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "workbench.colorCustomizations": { + "activityBar.background": "#062A69", + "titleBar.activeBackground": "#093A93", + "titleBar.activeForeground": "#F9FBFF" + } +} \ No newline at end of file From bd99c354c15a49bead55c100998130533fc38854 Mon Sep 17 00:00:00 2001 From: traBpUkciP Date: Thu, 18 Nov 2021 23:59:25 -0400 Subject: [PATCH 2/5] refactor docker setup & add dev build --- YuleLog | 4 ---- YuleLog-dev.sh | 6 ++++++ YuleLog.sh | 14 ++++++++++++++ docker-build.sh | 2 -- docker-run.sh | 2 -- dockerfile.dev | 23 +++++++++++++++++++++++ 6 files changed, 43 insertions(+), 8 deletions(-) delete mode 100755 YuleLog create mode 100755 YuleLog-dev.sh create mode 100755 YuleLog.sh delete mode 100644 docker-build.sh delete mode 100644 docker-run.sh create mode 100644 dockerfile.dev diff --git a/YuleLog b/YuleLog deleted file mode 100755 index 373d0d8..0000000 --- a/YuleLog +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -sh docker-build.sh -sh docker-run.sh diff --git a/YuleLog-dev.sh b/YuleLog-dev.sh new file mode 100755 index 0000000..1f7f5c3 --- /dev/null +++ b/YuleLog-dev.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +CONTAINER_NAME=yule_log + +docker build -t yule_log-dev --rm -f dockerfile.dev . +docker run -it --name yule_log_app-dev --rm yule_log-dev diff --git a/YuleLog.sh b/YuleLog.sh new file mode 100755 index 0000000..74b47ad --- /dev/null +++ b/YuleLog.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +CONTAINER_NAME=yule_log +VERSION=0.0.3-docker-2 + +if [[ $(docker images $CONTAINER_NAME:$VERSION | grep -w "$CONTAINER_NAME") ]]; then + echo "docker-run ..." + docker run -it --name yule_log_app --rm yule_log:$VERSION + +else + echo "docker-build ..." + docker build -t yule_log:$VERSION . + docker run -it --name yule_log_app --rm yule_log:$VERSION +fi diff --git a/docker-build.sh b/docker-build.sh deleted file mode 100644 index b16e1f4..0000000 --- a/docker-build.sh +++ /dev/null @@ -1,2 +0,0 @@ - -docker build -t yule_log --rm . diff --git a/docker-run.sh b/docker-run.sh deleted file mode 100644 index 7cb7cec..0000000 --- a/docker-run.sh +++ /dev/null @@ -1,2 +0,0 @@ - -docker run -it --name yule_log_app --rm yule_log diff --git a/dockerfile.dev b/dockerfile.dev new file mode 100644 index 0000000..3f24736 --- /dev/null +++ b/dockerfile.dev @@ -0,0 +1,23 @@ +FROM python:3.6-slim + +RUN useradd --create-home --shell /bin/bash app_user + +RUN apt-get -y update && apt-get install -y zlib1g-dev +RUN apt-get -y update && apt-get install -y libjpeg-dev +RUN apt-get -y update && apt-get install -y gcc + +ENV LDFLAGS=-L/usr/lib/x86_64-linux-gnu/ + +RUN /usr/local/bin/python -m pip install --upgrade pip + +WORKDIR /app + +COPY requirements.txt requirements.txt +RUN pip install -r requirements.txt + +COPY . . + +RUN pip install -e . + +USER app_user +CMD [ "YuleLog"] From ba45b266fb3e4f4e8b4c38264f9bafc91420edae Mon Sep 17 00:00:00 2001 From: traBpUkciP Date: Thu, 18 Nov 2021 23:59:37 -0400 Subject: [PATCH 3/5] update readme --- README.md | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e24dfd8..4b0e696 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,36 @@ -YuleLog -======= +# YuleLog + **Have yourself a Merry Terminal Christmas** ![logo](https://github.com/Duroktar/YuleLog/blob/master/yule_log/screenshot.png) -Overview --------- +## Overview + Yule Log Fireplace with a retro twist! - Restart the snowfall by pressing enter. - Press `x` to stop the program. -Tested with Python 2.7 and 3.5 on Linux and Windows. +Comes with a dockerized version for easy install. - **Made with Asciimatics!** - **WORKS BEST IN FULL SCREEN** -Installation / Usage --------------------- +## Installation -To install use pip: +If you have docker on linux/mac (recommended): - $ pip install YuleLog + $ git clone https://github.com/Duroktar/YuleLog.git + $ cd YuleLog/ + $ cp YuleLog.sh ~/bin/YuleLog +------- + +Or install use pip: + + $ pip install YuleLog Or clone the repo: @@ -32,18 +38,19 @@ Or clone the repo: $ python setup.py install -Example +> Tested for Python v[2.7, 3.5] on Linux, Mac, and Windows. + ------- -Run directly from the command line (thanks to setup.py entry script) +## Usage / Run Program - $ YuleLog - -Or as a python module +Run directly from the command line (for docker, pip, and/or manual builds) - $ python -m yule_log + $ YuleLog +If installed with pip or built manually you can also run it as a python module + $ python -m yule_log Changes ------- @@ -56,8 +63,6 @@ Version 0.0.2: Version 0.0.1: - First release - - Credits & thanks ---------------- - Asciimatics - https://github.com/peterbrittain/asciimatics From 162178117db96b81a72917ea61382aa9576702d8 Mon Sep 17 00:00:00 2001 From: traBpUkciP Date: Fri, 19 Nov 2021 00:00:14 -0400 Subject: [PATCH 4/5] position fire to always sit at bottom of screen --- yule_log/fire.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/yule_log/fire.py b/yule_log/fire.py index 0842c78..12c2ad4 100644 --- a/yule_log/fire.py +++ b/yule_log/fire.py @@ -39,11 +39,7 @@ def yule_log(screen): screen_height = screen.height screen_width = screen.width log_x = (screen_width // 2) - HALF_LOG_LENGTH - log_y = (screen_height // 2) + HALF_LOG_HEIGHT - if screen_height < 30: - log_y = screen_height // 3 - elif screen_height < 48: - log_y = screen_height // 2 + log_y = (screen_height) - LOG_HEIGHT scenes = [] From d794bbf0d7cfe211939fdef9e0eaa10e945dd7e5 Mon Sep 17 00:00:00 2001 From: traBpUkciP Date: Fri, 19 Nov 2021 00:10:30 -0400 Subject: [PATCH 5/5] update gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6580108..8038146 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ venv/* venv35/* venv36/* -*-docker.zip +*-docker*.zip *.pyc *.pyo