[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.15.182.217: ~ $
"""Timestamp comparison of files and groups of files."""

import functools
import os.path

from .errors import DistutilsFileError
from .py39compat import zip_strict
from ._functools import splat


def _newer(source, target):
    return not os.path.exists(target) or (
        os.path.getmtime(source) > os.path.getmtime(target)
    )


def newer(source, target):
    """
    Is source modified more recently than target.

    Returns True if 'source' is modified more recently than
    'target' or if 'target' does not exist.

    Raises DistutilsFileError if 'source' does not exist.
    """
    if not os.path.exists(source):
        raise DistutilsFileError("file '%s' does not exist" % os.path.abspath(source))

    return _newer(source, target)


def newer_pairwise(sources, targets, newer=newer):
    """
    Filter filenames where sources are newer than targets.

    Walk two filename iterables in parallel, testing if each source is newer
    than its corresponding target.  Returns a pair of lists (sources,
    targets) where source is newer than target, according to the semantics
    of 'newer()'.
    """
    newer_pairs = filter(splat(newer), zip_strict(sources, targets))
    return tuple(map(list, zip(*newer_pairs))) or ([], [])


def newer_group(sources, target, missing='error'):
    """
    Is target out-of-date with respect to any file in sources.

    Return True if 'target' is out-of-date with respect to any file
    listed in 'sources'. In other words, if 'target' exists and is newer
    than every file in 'sources', return False; otherwise return True.
    ``missing`` controls how to handle a missing source file:

    - error (default): allow the ``stat()`` call to fail.
    - ignore: silently disregard any missing source files.
    - newer: treat missing source files as "target out of date". This
      mode is handy in "dry-run" mode: it will pretend to carry out
      commands that wouldn't work because inputs are missing, but
      that doesn't matter because dry-run won't run the commands.
    """

    def missing_as_newer(source):
        return missing == 'newer' and not os.path.exists(source)

    ignored = os.path.exists if missing == 'ignore' else None
    return any(
        missing_as_newer(source) or _newer(source, target)
        for source in filter(ignored, sources)
    )


newer_pairwise_group = functools.partial(newer_pairwise, newer=newer_group)

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
command Folder 0755
__init__.py File 359 B 0644
_collections.py File 5.18 KB 0644
_functools.py File 1.73 KB 0644
_log.py File 43 B 0644
_macos_compat.py File 239 B 0644
_modified.py File 2.35 KB 0644
_msvccompiler.py File 19.16 KB 0644
archive_util.py File 8.37 KB 0644
bcppcompiler.py File 14.38 KB 0644
ccompiler.py File 47.5 KB 0644
cmd.py File 17.44 KB 0644
config.py File 4.8 KB 0644
core.py File 9.18 KB 0644
cygwinccompiler.py File 11.64 KB 0644
debug.py File 139 B 0644
dep_util.py File 349 B 0644
dir_util.py File 7.88 KB 0644
dist.py File 49 KB 0644
errors.py File 3.5 KB 0644
extension.py File 10.03 KB 0644
fancy_getopt.py File 17.48 KB 0644
file_util.py File 8.02 KB 0644
filelist.py File 13.39 KB 0644
log.py File 1.17 KB 0644
msvc9compiler.py File 29.48 KB 0644
msvccompiler.py File 23.02 KB 0644
py38compat.py File 217 B 0644
py39compat.py File 1.92 KB 0644
spawn.py File 3.41 KB 0644
sysconfig.py File 18.48 KB 0644
text_file.py File 11.8 KB 0644
unixccompiler.py File 15.24 KB 0644
util.py File 17.68 KB 0644
version.py File 12.65 KB 0644
versionpredicate.py File 5.08 KB 0644