Cleaned up fileutil, rolled back changes for #654
This commit is contained in:
@@ -278,8 +278,6 @@ class FileUtilNoOp(FileUtil):
|
|||||||
def noop(*args):
|
def noop(*args):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
verbose = noop
|
|
||||||
|
|
||||||
def __new__(cls, verbose=None):
|
def __new__(cls, verbose=None):
|
||||||
if verbose:
|
if verbose:
|
||||||
if callable(verbose):
|
if callable(verbose):
|
||||||
@@ -290,36 +288,35 @@ class FileUtilNoOp(FileUtil):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def hardlink(cls, src, dest):
|
def hardlink(cls, src, dest):
|
||||||
cls.verbose(f"hardlink: {src} {dest}")
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def copy(cls, src, dest, norsrc=False):
|
def copy(cls, src, dest, norsrc=False):
|
||||||
cls.verbose(f"copy: {src} {dest}")
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def unlink(cls, dest):
|
def unlink(cls, dest):
|
||||||
cls.verbose(f"unlink: {dest}")
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def rmdir(cls, dest):
|
def rmdir(cls, dest):
|
||||||
cls.verbose(f"rmdir: {dest}")
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def utime(cls, path, times):
|
def utime(cls, path, times):
|
||||||
cls.verbose(f"utime: {path}, {times}")
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def file_sig(cls, file1):
|
def file_sig(cls, file1):
|
||||||
cls.verbose(f"file_sig: {file1}")
|
|
||||||
return (42, 42, 42)
|
return (42, 42, 42)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def convert_to_jpeg(cls, src_file, dest_file, compression_quality=1.0):
|
def convert_to_jpeg(cls, src_file, dest_file, compression_quality=1.0):
|
||||||
cls.verbose(f"convert_to_jpeg: {src_file}, {dest_file}, {compression_quality}")
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def rename(cls, src, dest):
|
def rename(cls, src, dest):
|
||||||
cls.verbose(f"rename: {src}, {dest}")
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tmpdir(
|
def tmpdir(
|
||||||
@@ -330,5 +327,4 @@ class FileUtilNoOp(FileUtil):
|
|||||||
On completion of the context or destruction of the temporary directory object,
|
On completion of the context or destruction of the temporary directory object,
|
||||||
the newly created temporary directory and all its contents are removed from the filesystem.
|
the newly created temporary directory and all its contents are removed from the filesystem.
|
||||||
"""
|
"""
|
||||||
cls.verbose(f"tmpdir: {dir}")
|
|
||||||
return TemporaryDirectory(prefix=prefix, dir=dir)
|
return TemporaryDirectory(prefix=prefix, dir=dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user