示例#1
0
def python(files, input_files, **kwargs):
    remove = []
    add = []
    for path, fi in iteritems(files):
        if path.ext == '.pyc':
            pyfile = path.parent / path.stem + '.py'
            if pyfile.is_file():
                logging.info("Removing %s", path)
                remove.append(path)
                pyfile = path.parent / path.stem + '.py'
                if pyfile not in files:
                    logging.info("Adding %s", pyfile)
                    add.append(TracedFile(pyfile))

    for path in remove:
        files.pop(path, None)

    for fi in add:
        files[fi.path] = fi

    for i in irange(len(input_files)):
        lst = []
        for path in input_files[i]:
            if path.ext in ('.py', '.pyc'):
                logging.info("Removing input %s", path)
            else:
                lst.append(path)

        input_files[i] = lst
示例#2
0
def builtin(input_files, **kwargs):
    """Default heuristics for input files.
    """
    for i in irange(len(input_files)):
        lst = []
        for path in input_files[i]:
            if path.unicodename[0] == '.' or path.ext in ('.pyc', '.so'):
                logging.info("Removing input %s", path)
            else:
                lst.append(path)

        input_files[i] = lst
示例#3
0
def builtin(input_files, **kwargs):
    """Default heuristics for input files.
    """
    for i in irange(len(input_files)):
        lst = []
        for path in input_files[i]:
            if (
                    # Hidden files
                    path.unicodename[0] == '.' or
                    # Shared libraries
                    _so_file.search(path.name)):
                logger.info("Removing input %s", path)
            else:
                lst.append(path)

        input_files[i] = lst
示例#4
0
def python(files, input_files, **kwargs):
    add = []
    for path, fi in iteritems(files):
        if path.ext == b'.pyc':
            pyfile = path.parent / path.stem + '.py'
            if pyfile.is_file():
                if pyfile not in files:
                    logger.info("Adding %s", pyfile)
                    add.append(TracedFile(pyfile))

    for fi in add:
        files[fi.path] = fi

    for i in irange(len(input_files)):
        lst = []
        for path in input_files[i]:
            if path.ext in (b'.py', b'.pyc'):
                logger.info("Removing input %s", path)
            else:
                lst.append(path)

        input_files[i] = lst