Några fixar för enklare publicering
This commit is contained in:
parent
f93b9659a1
commit
65b283168b
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
.DS_Store
|
||||
slides/
|
||||
thumbnails/
|
@ -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('/<category>/<int:num>.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:
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user