From 65b283168bda660d9c78b14853d43ba03ce4e8b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Wed, 22 Mar 2017 20:16:45 +0100 Subject: [PATCH] =?UTF-8?q?N=C3=A5gra=20fixar=20f=C3=B6r=20enklare=20publi?= =?UTF-8?q?cering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ designbyloven.py | 6 +++--- instruktion.txt | 7 +++++++ sidor/startaom.sh.command | 1 - 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dc03faf --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +slides/ +thumbnails/ diff --git a/designbyloven.py b/designbyloven.py index bf42819..a3934e2 100755 --- a/designbyloven.py +++ b/designbyloven.py @@ -46,7 +46,7 @@ def thumbnails(category, num=0): catdir = pages + '/' + category thumbdir = catdir + '/thumbnails' if not os.path.isfile('%s/%d.jpg' % (thumbdir, num)): - images = sorted([x for x in next(os.walk(catdir))[2] if x.endswith('.jpg')]) + images = sorted([x for x in next(os.walk(catdir))[2] if x.endswith('.jpg')], key=lambda x: x.lower()) if not os.path.exists(thumbdir): os.makedirs(thumbdir) imgin = '%s/%s' % (catdir, images[num]) @@ -59,7 +59,7 @@ def slides(category, num=0): catdir = pages + '/' + category thumbdir = catdir + '/slides' if not os.path.isfile('%s/%d.jpg' % (thumbdir, num)): - images = sorted([x for x in next(os.walk(catdir))[2] if x.endswith('.jpg')]) + images = sorted([x for x in next(os.walk(catdir))[2] if x.endswith('.jpg')], key=lambda x: x.lower()) imgin = '%s/%s' % (catdir, images[num]) imgout = '%s/%d.jpg' % (thumbdir, num) if not os.path.exists(thumbdir): @@ -71,7 +71,7 @@ def slides(category, num=0): @app.route('//.jpg') def cat_photo(category, num): directory = pages + '/' + category - images = sorted([x for x in next(os.walk(directory))[2] if x.endswith('.jpg')]) + images = sorted([x for x in next(os.walk(directory))[2] if x.endswith('.jpg')], key=lambda x: x.lower()) try: return send_from_directory(directory, images[num]); except IndexError: diff --git a/instruktion.txt b/instruktion.txt index a32d683..c03bda1 100644 --- a/instruktion.txt +++ b/instruktion.txt @@ -9,3 +9,10 @@ arrakis:designbyloven $ workon designbyloven * Restarting with stat * Debugger is active! * Debugger pin code: 111-005-251 + + +ctrl+c för att stänga servern + +g aa (add all) +g ci -m ’Beskrivning av ändringar’ (check in) +g push (publicera) diff --git a/sidor/startaom.sh.command b/sidor/startaom.sh.command index 52150fe..262db3e 100755 --- a/sidor/startaom.sh.command +++ b/sidor/startaom.sh.command @@ -2,7 +2,6 @@ rm -r /Users/thomas/code/designbyloven/sidor/**/slides rm -r /Users/thomas/code/designbyloven/sidor/**/thumbnails -rm **/.DS_Store touch /Users/thomas/code/designbyloven/designbyloven.py exit 0