glob() does not sort any more - adding sorted() function
authorVolker Birk <vb@pep.foundation>
Sun, 15 Oct 2017 09:05:19 +0200
changeset 16 da8160da8d3e
parent 15 fa7016d48317
child 17 3bc118c7d324
glob() does not sort any more - adding sorted() function
backend.py
--- a/backend.py	Thu Sep 21 07:57:17 2017 +0200
+++ b/backend.py	Sun Oct 15 09:05:19 2017 +0200
@@ -725,14 +725,14 @@
                 filemask = arg
 
         if filemask[0] == '/' or filemask[0] == '.':
-            files = glob(filemask)
+            files = sorted(glob(filemask))
         else:
             files = []
             for directory in includePath:
                 path = os.path.join(directory, filemask)
-                files.extend(glob(path))
-
-        if reverse:
+                files.extend(sorted(glob(path)))
+
+        if files and reverse:
             files = files[-1::-1]
 
         if not(files):