1
0
Fork 0
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:
Joe R 2023-03-29 17:37:04 -04:00
parent dec1fd88f2
commit 4d0fb6942f
5 changed files with 7 additions and 7 deletions

View file

@ -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)

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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)