1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-22 03:04:09 -04:00

Use dict items (#439)

This commit is contained in:
Piotr Idzik 2025-04-16 03:09:17 +02:00 committed by GitHub
parent ce0c58b3be
commit 2b525aef4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 9 deletions

View file

@ -1158,10 +1158,9 @@ class Game(object):
# group stacks by class and cap
sg = {}
for s in self.allstacks:
for k in sg:
for k, g in sg.items():
if s.__class__ is k.__class__ and \
s.cap.__dict__ == k.cap.__dict__:
g = sg[k]
g.append(s.id)
break
else:

View file

@ -116,8 +116,8 @@ class tkHTMLWriter(pysollib.formatter.NullWriter):
}
self.text.config(cursor=self.viewer.defcursor, font=font)
for f in self.fontmap.keys():
self.text.tag_config(f, font=self.fontmap[f])
for f, font in self.fontmap.items():
self.text.tag_config(f, font=font)
self.anchor = None
self.anchor_mark = None

View file

@ -652,12 +652,12 @@ class CardsetManager(ResourceManager):
required_cards_needed = {
CSI.TYPE_TRUMP_ONLY: 100
}
for t in required_types.keys():
for t, t_v in required_types.items():
if t not in self.registered_types:
missing.append(CSI.TYPE_NAME[t])
else:
if len(required_types[t]) > 0:
for tt in required_types[t]:
if len(t_v) > 0:
for tt in t_v:
if tt not in self.registered_subtypes[t]:
missing.append(CSI.TYPE_NAME[t] + " (" +
CSI.SUBTYPE_NAME[t][tt] + ")")

View file

@ -412,9 +412,9 @@ class PysolToolbarTk:
self.frame.update_idletasks()
def updateText(self, **kw):
for name in kw.keys():
for name, value in kw.items():
label = getattr(self, name + "_label")
label["text"] = kw[name]
label["text"] = value
def updateImages(self, dir, size):
if dir == self.dir and size == self.size: