diff --git a/.gitignore b/.gitignore index 16f2746..9dec299 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ __pycache__ celerybeat-schedule +.doit.db +static/logotype*.png diff --git a/media/2017-08-03-forget-logotype.kra b/assets/2017-08-03-forget-logotype.kra similarity index 100% rename from media/2017-08-03-forget-logotype.kra rename to assets/2017-08-03-forget-logotype.kra diff --git a/media/icon.svg b/assets/icon.svg similarity index 100% rename from media/icon.svg rename to assets/icon.svg diff --git a/static/logotype.png b/assets/logotype.png similarity index 100% rename from static/logotype.png rename to assets/logotype.png diff --git a/dodo.py b/dodo.py new file mode 100644 index 0000000..b8b5fec --- /dev/null +++ b/dodo.py @@ -0,0 +1,26 @@ +def task_gen_logo(): + """generate versions of the logo in various sizes""" + + from PIL import Image + + widths = (200, 400, 600, 800) + + def gen_logo(): + with Image.open('assets/logotype.png') as im: + im = im.convert('L') + for width in widths: + height = im.height * width // im.width + new = im.resize((width,height), resample=Image.LANCZOS) + new.save('static/logotype-{}.png'.format(width)) + im.save('static/logotype.png') + + return { + 'actions': [gen_logo], + 'targets': [f'static/logotype-{width}.png' for width in widths]\ + + ['static/logotype.png'], + 'file_dep': ['assets/logotype.png'], + } + +if __name__ == '__main__': + import doit + doit.run(globals()) diff --git a/media/promo1.png b/media/promo1.png deleted file mode 100644 index 9a5d905..0000000 Binary files a/media/promo1.png and /dev/null differ diff --git a/media/promo2.png b/media/promo2.png deleted file mode 100644 index 6671452..0000000 Binary files a/media/promo2.png and /dev/null differ diff --git a/requirements.txt b/requirements.txt index 5e343ea..cce45ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,9 @@ billiard==3.5.0.3 blinker==1.4 celery==4.1.0 click==6.7 +cloudpickle==0.4.0 contextlib2==0.5.5 +doit==0.30.3 Flask==0.12.2 Flask-Limiter==0.9.5 Flask-Migrate==2.0.4 @@ -18,7 +20,10 @@ kombu==4.1.0 limits==1.2.1 Mako==1.0.6 MarkupSafe==1.0 +olefile==0.44 +Pillow==4.2.1 psycopg2==2.7.1 +pyinotify==0.9.6 python-dateutil==2.6.0 python-editor==1.0.3 pytz==2017.2 diff --git a/templates/lib/layout.html b/templates/lib/layout.html index 3b28ef6..078c7ad 100644 --- a/templates/lib/layout.html +++ b/templates/lib/layout.html @@ -17,7 +17,9 @@

- Forget + Forget

diff --git a/tools/post-receive.example b/tools/post-receive.example index 648f789..e24eab7 100644 --- a/tools/post-receive.example +++ b/tools/post-receive.example @@ -15,6 +15,11 @@ while read old new refname; do pip install -r requirements.txt tools/write-version.sh FLASK_APP='forget.py' flask db upgrade + if [[ $(git diff --name-only ${old}..${new} dodo.py) == 'dodo.py' ]] + then + doit forget + fi + doit ) systemctl --user start forget fi