mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Made sorting of games/cardsets/table tile lists case-insensitive.
This commit is contained in:
parent
dec1fd88f2
commit
4d0fb6942f
5 changed files with 7 additions and 7 deletions
|
@ -242,7 +242,7 @@ def gen_rules_html():
|
|||
file=out_rules_alt)
|
||||
with open('rules_alternate.html', 'r') as file:
|
||||
print(file.read(), file=out_rules_alt)
|
||||
altnames.sort()
|
||||
altnames.sort(key=lambda x: x[0].lower())
|
||||
for name, fn in altnames:
|
||||
print('<li> <a href="rules/%s">%s</a>'
|
||||
% (fn, name), file=out_rules_alt)
|
||||
|
|
|
@ -809,13 +809,13 @@ class GameManager:
|
|||
if self.__games_by_name is None:
|
||||
l1, l2, l3 = [], [], []
|
||||
for id, gi in self.__games.items():
|
||||
name = gi.name # .lower()
|
||||
name = gi.name .lower()
|
||||
l1.append((name, id))
|
||||
if gi.name != gi.short_name:
|
||||
name = gi.short_name # .lower()
|
||||
name = gi.short_name.lower()
|
||||
l2.append((name, id))
|
||||
for n in gi.altnames:
|
||||
name = n # .lower()
|
||||
name = n.lower()
|
||||
l3.append((name, id, n))
|
||||
l1.sort()
|
||||
l2.sort()
|
||||
|
|
|
@ -519,7 +519,7 @@ class SelectCardsetDialogWithPreview(MfxDialog):
|
|||
if self.app.checkSearchString(self.criteria.name,
|
||||
cardset.name):
|
||||
results.append(cardset.name)
|
||||
results.sort()
|
||||
results.sort(key=lambda x: x.lower())
|
||||
pos = 0
|
||||
for result in results:
|
||||
self.list.insert(pos, result)
|
||||
|
|
|
@ -632,7 +632,7 @@ class SelectGameDialogWithPreview(SelectGameDialog):
|
|||
for altname in game.altnames:
|
||||
if self.app.checkSearchString(self.criteria.name, altname):
|
||||
results.append(altname)
|
||||
results.sort()
|
||||
results.sort(key=lambda x: x.lower())
|
||||
pos = 0
|
||||
for result in results:
|
||||
self.list.insert(pos, result)
|
||||
|
|
|
@ -318,7 +318,7 @@ class SelectTileDialogWithPreview(MfxDialog):
|
|||
if self.app.checkSearchString(self.criteria.name,
|
||||
tile.name):
|
||||
results.append(tile.name)
|
||||
results.sort()
|
||||
results.sort(key=lambda x: x.lower())
|
||||
pos = 0
|
||||
for result in results:
|
||||
self.list.insert(pos, result)
|
||||
|
|
Loading…
Add table
Reference in a new issue