当前位置: 首页>>代码示例>>Python>>正文


Python moves.filterfalse方法代码示例

本文整理汇总了Python中setuptools.extern.six.moves.filterfalse方法的典型用法代码示例。如果您正苦于以下问题:Python moves.filterfalse方法的具体用法?Python moves.filterfalse怎么用?Python moves.filterfalse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在setuptools.extern.six.moves的用法示例。


在下文中一共展示了moves.filterfalse方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: find

# 需要导入模块: from setuptools.extern.six import moves [as 别名]
# 或者: from setuptools.extern.six.moves import filterfalse [as 别名]
def find(cls, where='.', exclude=(), include=('*',)):
        """Return a list all Python packages found within directory 'where'

        'where' should be supplied as a "cross-platform" (i.e. URL-style)
        path; it will be converted to the appropriate local path syntax.
        'exclude' is a sequence of package names to exclude; '*' can be used
        as a wildcard in the names, such that 'foo.*' will exclude all
        subpackages of 'foo' (but not 'foo' itself).

        'include' is a sequence of package names to include.  If it's
        specified, only the named packages will be included.  If it's not
        specified, all found packages will be included.  'include' can contain
        shell style wildcard patterns just like 'exclude'.

        The list of included packages is built up first and then any
        explicitly excluded packages are removed from it.
        """
        out = cls._find_packages_iter(convert_path(where))
        out = cls.require_parents(out)
        includes = cls._build_filter(*include)
        excludes = cls._build_filter('ez_setup', '*__pycache__', *exclude)
        out = filter(includes, out)
        out = filterfalse(excludes, out)
        return list(out) 
开发者ID:jpush,项目名称:jbox,代码行数:26,代码来源:__init__.py

示例2: _unique_everseen

# 需要导入模块: from setuptools.extern.six import moves [as 别名]
# 或者: from setuptools.extern.six.moves import filterfalse [as 别名]
def _unique_everseen(iterable, key=None):
    "List unique elements, preserving order. Remember all elements ever seen."
    # unique_everseen('AAAABBBCCDAABBB') --> A B C D
    # unique_everseen('ABBCcAD', str.lower) --> A B C D
    seen = set()
    seen_add = seen.add
    if key is None:
        for element in filterfalse(seen.__contains__, iterable):
            seen_add(element)
            yield element
    else:
        for element in iterable:
            k = key(element)
            if k not in seen:
                seen_add(k)
                yield element 
开发者ID:sofia-netsurv,项目名称:python-netsurv,代码行数:18,代码来源:build_py.py

示例3: _unique_everseen

# 需要导入模块: from setuptools.extern.six import moves [as 别名]
# 或者: from setuptools.extern.six.moves import filterfalse [as 别名]
def _unique_everseen(self, iterable, key=None):
        """
        List unique elements, preserving order.
        Remember all elements ever seen.

        _unique_everseen('AAAABBBCCDAABBB') --> A B C D

        _unique_everseen('ABBCcAD', str.lower) --> A B C D
        """
        seen = set()
        seen_add = seen.add
        if key is None:
            for element in filterfalse(seen.__contains__, iterable):
                seen_add(element)
                yield element
        else:
            for element in iterable:
                k = key(element)
                if k not in seen:
                    seen_add(k)
                    yield element 
开发者ID:sofia-netsurv,项目名称:python-netsurv,代码行数:23,代码来源:msvc.py

示例4: _move_install_requirements_markers

# 需要导入模块: from setuptools.extern.six import moves [as 别名]
# 或者: from setuptools.extern.six.moves import filterfalse [as 别名]
def _move_install_requirements_markers(self):
        """
        Move requirements in `install_requires` that are using environment
        markers `extras_require`.
        """

        # divide the install_requires into two sets, simple ones still
        # handled by install_requires and more complex ones handled
        # by extras_require.

        def is_simple_req(req):
            return not req.marker

        spec_inst_reqs = getattr(self, 'install_requires', None) or ()
        inst_reqs = list(pkg_resources.parse_requirements(spec_inst_reqs))
        simple_reqs = filter(is_simple_req, inst_reqs)
        complex_reqs = filterfalse(is_simple_req, inst_reqs)
        self.install_requires = list(map(str, simple_reqs))

        for r in complex_reqs:
            self._tmp_extras_require[':' + str(r.marker)].append(r)
        self.extras_require = dict(
            (k, [str(r) for r in map(self._clean_req, v)])
            for k, v in self._tmp_extras_require.items()
        ) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:27,代码来源:dist.py


注:本文中的setuptools.extern.six.moves.filterfalse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。