本文整理匯總了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)