mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-22 20:38:00 +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:
|
if ending is not None:
|
||||||
for directory in directories:
|
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):
|
if (not endswith(filename, ending)) or (len(filename) - len(ending) > 127):
|
||||||
continue
|
continue
|
||||||
proper = filename[:-len(ending)]
|
proper = filename[:-len(ending)]
|
||||||
|
@ -105,7 +107,9 @@ class SpelloCorrecter(): # Naïvely and quickly ported and adapted from optimise
|
||||||
previous = proper
|
previous = proper
|
||||||
self.reusable[self.dictionaryEnd] = prevCommon
|
self.reusable[self.dictionaryEnd] = prevCommon
|
||||||
else:
|
else:
|
||||||
for proper in directories:
|
files = directories
|
||||||
|
files.sort()
|
||||||
|
for proper in files:
|
||||||
if len(proper) > 127:
|
if len(proper) > 127:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue