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:
parent
ce0c58b3be
commit
2b525aef4c
4 changed files with 8 additions and 9 deletions
|
@ -1158,10 +1158,9 @@ class Game(object):
|
||||||
# group stacks by class and cap
|
# group stacks by class and cap
|
||||||
sg = {}
|
sg = {}
|
||||||
for s in self.allstacks:
|
for s in self.allstacks:
|
||||||
for k in sg:
|
for k, g in sg.items():
|
||||||
if s.__class__ is k.__class__ and \
|
if s.__class__ is k.__class__ and \
|
||||||
s.cap.__dict__ == k.cap.__dict__:
|
s.cap.__dict__ == k.cap.__dict__:
|
||||||
g = sg[k]
|
|
||||||
g.append(s.id)
|
g.append(s.id)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -116,8 +116,8 @@ class tkHTMLWriter(pysollib.formatter.NullWriter):
|
||||||
}
|
}
|
||||||
|
|
||||||
self.text.config(cursor=self.viewer.defcursor, font=font)
|
self.text.config(cursor=self.viewer.defcursor, font=font)
|
||||||
for f in self.fontmap.keys():
|
for f, font in self.fontmap.items():
|
||||||
self.text.tag_config(f, font=self.fontmap[f])
|
self.text.tag_config(f, font=font)
|
||||||
|
|
||||||
self.anchor = None
|
self.anchor = None
|
||||||
self.anchor_mark = None
|
self.anchor_mark = None
|
||||||
|
|
|
@ -652,12 +652,12 @@ class CardsetManager(ResourceManager):
|
||||||
required_cards_needed = {
|
required_cards_needed = {
|
||||||
CSI.TYPE_TRUMP_ONLY: 100
|
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:
|
if t not in self.registered_types:
|
||||||
missing.append(CSI.TYPE_NAME[t])
|
missing.append(CSI.TYPE_NAME[t])
|
||||||
else:
|
else:
|
||||||
if len(required_types[t]) > 0:
|
if len(t_v) > 0:
|
||||||
for tt in required_types[t]:
|
for tt in t_v:
|
||||||
if tt not in self.registered_subtypes[t]:
|
if tt not in self.registered_subtypes[t]:
|
||||||
missing.append(CSI.TYPE_NAME[t] + " (" +
|
missing.append(CSI.TYPE_NAME[t] + " (" +
|
||||||
CSI.SUBTYPE_NAME[t][tt] + ")")
|
CSI.SUBTYPE_NAME[t][tt] + ")")
|
||||||
|
|
|
@ -412,9 +412,9 @@ class PysolToolbarTk:
|
||||||
self.frame.update_idletasks()
|
self.frame.update_idletasks()
|
||||||
|
|
||||||
def updateText(self, **kw):
|
def updateText(self, **kw):
|
||||||
for name in kw.keys():
|
for name, value in kw.items():
|
||||||
label = getattr(self, name + "_label")
|
label = getattr(self, name + "_label")
|
||||||
label["text"] = kw[name]
|
label["text"] = value
|
||||||
|
|
||||||
def updateImages(self, dir, size):
|
def updateImages(self, dir, size):
|
||||||
if dir == self.dir and size == self.size:
|
if dir == self.dir and size == self.size:
|
||||||
|
|
Loading…
Add table
Reference in a new issue