1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Refactoring.

This commit is contained in:
Shlomi Fish 2018-03-13 13:16:49 +02:00
parent 033f99e4f2
commit af493722c8
2 changed files with 3 additions and 10 deletions

View file

@ -214,11 +214,11 @@ class SelectCardsetDialogWithPreview(MfxDialog):
for image in self.preview_images: for image in self.preview_images:
MfxCanvasImage(canvas, x, y, anchor="nw", image=image) MfxCanvasImage(canvas, x, y, anchor="nw", image=image)
sx, sy = max(x, sx), max(y, sy) sx, sy = max(x, sx), max(y, sy)
i = i + 1 i += 1
if i % columns == 0: if i % columns == 0:
x, y = 10, y + dy x, y = 10, y + dy
else: else:
x = x + dx x += dx
canvas.config(width=sx+dx, height=sy+dy) canvas.config(width=sx+dx, height=sy+dy)
canvas.set_scroll_region(0, 0, sx+dx, sy+dy) canvas.set_scroll_region(0, 0, sx+dx, sy+dy)
self.preview_key = key self.preview_key = key

View file

@ -110,14 +110,7 @@ class DataLoader:
self.path.append(np) self.path.append(np)
# now try to find all filenames along path # now try to find all filenames along path
for p in self.path: for p in self.path:
n = 0 if all(os.path.isfile(os.path.join(p, fn)) for fn in filenames):
for filename in filenames:
f = os.path.join(p, filename)
if os.path.isfile(f):
n = n + 1
else:
break
if n == len(filenames):
self.dir = p self.dir = p
break break
else: else: