mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-22 04:27:58 +01:00
files are horrible unsorted
Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
parent
4826c4952a
commit
3aded082c2
1 changed files with 6 additions and 2 deletions
|
@ -84,7 +84,9 @@ class SpelloCorrecter(): # Naïvely and quickly ported and adapted from optimise
|
|||
|
||||
if ending is not None:
|
||||
for directory in directories:
|
||||
for filename in os.listdir(directory):
|
||||
files = os.listdir(directory)
|
||||
files.sort()
|
||||
for filename in files:
|
||||
if (not endswith(filename, ending)) or (len(filename) - len(ending) > 127):
|
||||
continue
|
||||
proper = filename[:-len(ending)]
|
||||
|
@ -105,7 +107,9 @@ class SpelloCorrecter(): # Naïvely and quickly ported and adapted from optimise
|
|||
previous = proper
|
||||
self.reusable[self.dictionaryEnd] = prevCommon
|
||||
else:
|
||||
for proper in directories:
|
||||
files = directories
|
||||
files.sort()
|
||||
for proper in files:
|
||||
if len(proper) > 127:
|
||||
continue
|
||||
|
||||
|
|
Loading…
Reference in a new issue