diff --git a/src/sigal/__main__.py b/src/sigal/__main__.py index 9643ac9..76bedaf 100644 --- a/src/sigal/__main__.py +++ b/src/sigal/__main__.py @@ -134,6 +134,7 @@ def build( if sum([debug, verbose, quiet]) > 1: sys.exit("Only one option of debug, verbose and quiet should be used") + show_progress = False if debug: level = logging.DEBUG elif verbose: @@ -142,6 +143,7 @@ def build( level = logging.ERROR else: level = logging.WARNING + show_progress = True init_logging(__name__, level=level) logger = logging.getLogger(__name__) @@ -184,7 +186,7 @@ def build( locale.setlocale(locale.LC_ALL, settings["locale"]) init_plugins(settings) - gal = Gallery(settings, ncpu=ncpu, quiet=quiet) + gal = Gallery(settings, ncpu=ncpu, show_progress=show_progress) gal.build(force=force_album if len(force_album) else force) # copy extra files diff --git a/src/sigal/gallery.py b/src/sigal/gallery.py index 7d13e9f..6684f53 100644 --- a/src/sigal/gallery.py +++ b/src/sigal/gallery.py @@ -701,7 +701,7 @@ class Album: class Gallery: - def __init__(self, settings, ncpu=None, quiet=False): + def __init__(self, settings, ncpu=None, show_progress=False): self.settings = settings self.logger = logging.getLogger(__name__) self.stats = defaultdict(int) @@ -724,10 +724,7 @@ class Gallery: except io.UnsupportedOperation: isatty = False - show_progress = ( - not quiet and self.logger.getEffectiveLevel() >= logging.WARNING and isatty - ) - self.progressbar_target = None if show_progress else Devnull() + self.progressbar_target = None if show_progress and isatty else Devnull() for path, dirs, files in os.walk(src_path, followlinks=True, topdown=False): if show_progress: @@ -910,7 +907,7 @@ class Gallery: if album.albums: if album.medias: self.logger.warning( - "Album %s contains sub-albums and images. " + "Album '%s' contains sub-albums and images. " "Please move images to their own sub-album. " "Images in album %s will not be visible.", album.title,