diff --git a/pysollib/pysolgtk/selectcardset.py b/pysollib/pysolgtk/selectcardset.py index 8eba890d..ccef27b2 100644 --- a/pysollib/pysolgtk/selectcardset.py +++ b/pysollib/pysolgtk/selectcardset.py @@ -214,11 +214,11 @@ class SelectCardsetDialogWithPreview(MfxDialog): for image in self.preview_images: MfxCanvasImage(canvas, x, y, anchor="nw", image=image) sx, sy = max(x, sx), max(y, sy) - i = i + 1 + i += 1 if i % columns == 0: x, y = 10, y + dy else: - x = x + dx + x += dx canvas.config(width=sx+dx, height=sy+dy) canvas.set_scroll_region(0, 0, sx+dx, sy+dy) self.preview_key = key diff --git a/pysollib/util.py b/pysollib/util.py index a5c03904..1a8d505d 100644 --- a/pysollib/util.py +++ b/pysollib/util.py @@ -110,14 +110,7 @@ class DataLoader: self.path.append(np) # now try to find all filenames along path for p in self.path: - n = 0 - for filename in filenames: - f = os.path.join(p, filename) - if os.path.isfile(f): - n = n + 1 - else: - break - if n == len(filenames): + if all(os.path.isfile(os.path.join(p, fn)) for fn in filenames): self.dir = p break else: