本文整理汇总了Python中pip.util.splitext方法的典型用法代码示例。如果您正苦于以下问题:Python util.splitext方法的具体用法?Python util.splitext怎么用?Python util.splitext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pip.util
的用法示例。
在下文中一共展示了util.splitext方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: splitext
# 需要导入模块: from pip import util [as 别名]
# 或者: from pip.util import splitext [as 别名]
def splitext(self):
return splitext(posixpath.basename(self.path.rstrip('/')))
示例2: ext
# 需要导入模块: from pip import util [as 别名]
# 或者: from pip.util import splitext [as 别名]
def ext(self):
return self.splitext()[1]
示例3: get_requirement_from_url
# 需要导入模块: from pip import util [as 别名]
# 或者: from pip.util import splitext [as 别名]
def get_requirement_from_url(url):
"""Get a requirement from the URL, if possible. This looks for #egg
in the URL"""
link = Link(url)
egg_info = link.egg_fragment
if not egg_info:
egg_info = splitext(link.filename)[0]
return package_to_requirement(egg_info)
示例4: __init__
# 需要导入模块: from pip import util [as 别名]
# 或者: from pip.util import splitext [as 别名]
def __init__(self, url, comes_from=None, internal=None, trusted=None):
self.url = url
self.comes_from = comes_from
self.internal = internal
self.trusted = trusted
# Set whether it's a wheel
self.wheel = None
if url != Inf and self.splitext()[1] == wheel_ext:
self.wheel = Wheel(self.filename)