From 5943f4ef4f0af841d83f365f6feacb2fb52774fa Mon Sep 17 00:00:00 2001 From: Ryohei Ueda Date: Sun, 2 Nov 2014 22:33:33 +0900 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E7=94=BB?= =?UTF-8?q?=E5=83=8F=E3=82=92=E3=82=BD=E3=83=BC=E3=83=88=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/views.py b/views.py index 1841b92..4ba8c74 100644 --- a/views.py +++ b/views.py @@ -13,7 +13,7 @@ image_ptrn = re.compile('.*[.](jpg|jpeg|png|bmp|gif)$') image_dir = os.path.join( 'static', 'img' ) images = [] -images = [ image for image in os.listdir( image_dir ) if re.match( image_ptrn, image ) ] +images = sorted([image for image in os.listdir( image_dir ) if re.match( image_ptrn, image )]) if not len( images ): sys.exit( 'Error: Could not find images') @@ -54,7 +54,6 @@ def _next(): #囲まれた範囲の座標 coords = request.args.get('coords') coords = json.loads(coords) - #処理中の画像のパス image_path = os.path.join( image_dir, images[pos] )