Python email.parser 模块,FeedParser() 实例源码
我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用email.parser.FeedParser()。
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name,
requires_python,
'.'.join(map(str, sys.version_info[:3])),)
)
except specifiers.InvalidSpecifier as e:
logger.warning(
"Package %s has an invalid Requires-Python entry %s - %s" % (
dist.project_name, requires_python, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name,
os.environ['PIP_PYTHON_VERSION']
)
)
except specifiers.InvalidSpecifier as e:
logger.warning(
"Package %s has an invalid Requires-Python entry %s - %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
def check_dist_requires_python(dist):
Metadata = get_Metadata(dist)
Feed_parser = FeedParser()
Feed_parser.Feed(Metadata)
pkg_info_dict = Feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name, e))
return
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。