diff --git a/sigal/gallery.py b/sigal/gallery.py index f5b79c9..536366d 100644 --- a/sigal/gallery.py +++ b/sigal/gallery.py @@ -42,21 +42,12 @@ from . import image, video, signals from .compat import UnicodeMixin, strxfrm, url_quote from .image import process_image, get_exif_tags from .settings import get_thumb -from .utils import copy, check_or_create_dir, url_from_path, read_markdown +from .utils import (Devnull, copy, check_or_create_dir, url_from_path, + read_markdown) from .video import process_video from .writer import Writer -class Devnull(object): - """'Black hole' for output that should not be printed""" - - def write(self, *_): - pass - - def flush(self, *_): - pass - - class Media(UnicodeMixin): """Base Class for media files. diff --git a/sigal/utils.py b/sigal/utils.py index bdefe1b..fb9418d 100644 --- a/sigal/utils.py +++ b/sigal/utils.py @@ -29,6 +29,16 @@ from subprocess import Popen, PIPE from . import compat +class Devnull(object): + """'Black hole' for output that should not be printed""" + + def write(self, *_): + pass + + def flush(self, *_): + pass + + def copy(src, dst, symlink=False): """Copy or symlink the file.""" func = os.symlink if symlink else shutil.copy2