diff options
-rw-r--r-- | ranger/core/loader.py | 12 | ||||
-rw-r--r-- | ranger/ext/shutil_generatorized.py | 11 |
2 files changed, 13 insertions, 10 deletions
diff --git a/ranger/core/loader.py b/ranger/core/loader.py index 54463f5a..0da8f361 100644 --- a/ranger/core/loader.py +++ b/ranger/core/loader.py @@ -50,7 +50,8 @@ class Loadable(object): pass -class CopyLoader(Loadable, FileManagerAware, SettingsAware): # pylint: disable=too-many-instance-attributes +class CopyLoader(Loadable, FileManagerAware, # pylint: disable=too-many-instance-attributes + SettingsAware): progressbar_supported = True def __init__(self, copy_buffer, do_cut=False, overwrite=False, dest=None, @@ -118,8 +119,7 @@ class CopyLoader(Loadable, FileManagerAware, SettingsAware): # pylint: disable= yield done += n else: - if self.settings.enable_copy_on_write and PY3: - enable_copy_on_write = True + enable_copy_on_write = self.settings.enable_copy_on_write and PY3 if len(self.copy_buffer) == 1: self.description = "copying: " + self.one_file.path + size_str else: @@ -140,9 +140,9 @@ class CopyLoader(Loadable, FileManagerAware, SettingsAware): # pylint: disable= else: n = 0 for n in shutil_g.copy2(fobj.path, self.original_path, - symlinks=True, overwrite=self.overwrite, - make_safe_path=self.make_safe_path, - enable_copy_on_write=enable_copy_on_write): + symlinks=True, overwrite=self.overwrite, + make_safe_path=self.make_safe_path, + enable_copy_on_write=enable_copy_on_write): self.percent = ((done + n) / size) * 100. yield done += n diff --git a/ranger/ext/shutil_generatorized.py b/ranger/ext/shutil_generatorized.py index eac95a93..be39eee4 100644 --- a/ranger/ext/shutil_generatorized.py +++ b/ranger/ext/shutil_generatorized.py @@ -142,7 +142,8 @@ def copyfile(src, dst, enable_copy_on_write=False): yield done -def copy2(src, dst, overwrite=False, symlinks=False, make_safe_path=get_safe_path, enable_copy_on_write=False): +def copy2(src, dst, overwrite=False, symlinks=False, make_safe_path=get_safe_path, + enable_copy_on_write=False): """Copy data and all stat info ("cp -p src dst"). The destination may be a directory. @@ -163,8 +164,9 @@ def copy2(src, dst, overwrite=False, symlinks=False, make_safe_path=get_safe_pat copystat(src, dst) -def copytree(src, dst, # pylint: disable=too-many-locals,too-many-branches - symlinks=False, ignore=None, overwrite=False, make_safe_path=get_safe_path, enable_copy_on_write=False): +def copytree(src, dst, # pylint: disable=too-many-locals,too-many-branches,too-many-arguments + symlinks=False, ignore=None, overwrite=False, make_safe_path=get_safe_path, + enable_copy_on_write=False): """Recursively copy a directory tree using copy2(). The destination directory must not already exist. @@ -226,7 +228,8 @@ def copytree(src, dst, # pylint: disable=too-many-locals,too-many-branches # Will raise a SpecialFileError for unsupported file types n = 0 for n in copy2(srcname, dstname, overwrite=overwrite, symlinks=symlinks, - make_safe_path=make_safe_path, enable_copy_on_write=enable_copy_on_write): + make_safe_path=make_safe_path, + enable_copy_on_write=enable_copy_on_write): yield done + n done += n # catch the Error from the recursive copytree so that we can |