本文整理汇总了Python中pip._vendor.six.moves.filterfalse方法的典型用法代码示例。如果您正苦于以下问题:Python moves.filterfalse方法的具体用法?Python moves.filterfalse怎么用?Python moves.filterfalse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pip._vendor.six.moves
的用法示例。
在下文中一共展示了moves.filterfalse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: skip_regex
# 需要导入模块: from pip._vendor.six import moves [as 别名]
# 或者: from pip._vendor.six.moves import filterfalse [as 别名]
def skip_regex(lines_enum, options):
"""
Skip lines that match '--skip-requirements-regex' pattern
Note: the regex pattern is only built once
"""
skip_regex = options.skip_requirements_regex if options else None
if skip_regex:
pattern = re.compile(skip_regex)
lines_enum = filterfalse(
lambda e: pattern.search(e[1]),
lines_enum)
return lines_enum
示例2: skip_regex
# 需要导入模块: from pip._vendor.six import moves [as 别名]
# 或者: from pip._vendor.six.moves import filterfalse [as 别名]
def skip_regex(lines_enum, options):
"""
Skip lines that match '--skip-requirements-regex' pattern
Note: the regex pattern is only built once
"""
skip_regex = options.skip_requirements_regex if options else None
if skip_regex:
pattern = re.compile(skip_regex)
lines_enum = filterfalse(lambda e: pattern.search(e[1]), lines_enum)
return lines_enum
示例3: skip_regex
# 需要导入模块: from pip._vendor.six import moves [as 别名]
# 或者: from pip._vendor.six.moves import filterfalse [as 别名]
def skip_regex(lines_enum, options):
# type: (ReqFileLines, Optional[optparse.Values]) -> ReqFileLines
"""
Skip lines that match '--skip-requirements-regex' pattern
Note: the regex pattern is only built once
"""
skip_regex = options.skip_requirements_regex if options else None
if skip_regex:
pattern = re.compile(skip_regex)
lines_enum = filterfalse(lambda e: pattern.search(e[1]), lines_enum)
return lines_enum
示例4: skip_regex
# 需要导入模块: from pip._vendor.six import moves [as 别名]
# 或者: from pip._vendor.six.moves import filterfalse [as 别名]
def skip_regex(lines_enum, pattern):
# type: (ReqFileLines, str) -> ReqFileLines
"""
Skip lines that match the provided pattern
Note: the regex pattern is only built once
"""
matcher = re.compile(pattern)
lines_enum = filterfalse(lambda e: matcher.search(e[1]), lines_enum)
return lines_enum
示例5: skip_regex
# 需要导入模块: from pip._vendor.six import moves [as 别名]
# 或者: from pip._vendor.six.moves import filterfalse [as 别名]
def skip_regex(lines, options):
"""
Optionally exclude lines that match '--skip-requirements-regex'
"""
skip_regex = options.skip_requirements_regex if options else None
if skip_regex:
lines = filterfalse(re.compile(skip_regex).search, lines)
return lines