Move Devnull to the utils module.
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user