mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-12 08:25:01 -05:00
This commit is contained in:
1 parent
8fdbdc3fa9
commit
d99c6c11fc
2 files changed
+13
-7
No files matched your search
@@ -23,6 +23,8 @@ Incompatible changes
|
||||
``index.rst.txt``).
|
||||
* ``sphinx.util.copy_static_entry()`` is now deprecated.
|
||||
Use ``sphinx.util.fileutil.copy_asset()`` instead.
|
||||
* ``sphinx.util.osutil.filecopy()`` skips copying if the file has not been changed
|
||||
(ref: #2510, #2753)
|
||||
|
||||
|
||||
Features added
|
||||
|
||||
+11
-7
@@ -17,6 +17,7 @@ import time
|
||||
import errno
|
||||
import locale
|
||||
import shutil
|
||||
import filecmp
|
||||
from os import path
|
||||
import contextlib
|
||||
|
||||
@@ -141,13 +142,16 @@ def copytimes(source, dest):
|
||||
|
||||
|
||||
def copyfile(source, dest):
|
||||
"""Copy a file and its modification times, if possible."""
|
||||
shutil.copyfile(source, dest)
|
||||
try:
|
||||
# don't do full copystat because the source may be read-only
|
||||
copytimes(source, dest)
|
||||
except OSError:
|
||||
pass
|
||||
"""Copy a file and its modification times, if possible.
|
||||
|
||||
Note: ``copyfile`` skips copying if the file has not been changed"""
|
||||
if not path.exists(dest) or not filecmp.cmp(source, dest):
|
||||
shutil.copyfile(source, dest)
|
||||
try:
|
||||
# don't do full copystat because the source may be read-only
|
||||
copytimes(source, dest)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
no_fn_re = re.compile(r'[^a-zA-Z0-9_-]')
|
||||
|
||||
Reference in new issue
Block a user