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


Python utils.normalize_path方法代码示例

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


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

示例1: add

# 需要导入模块: from pip import utils [as 别名]
# 或者: from pip.utils import normalize_path [as 别名]
def add(self, path):
        head, tail = os.path.split(path)

        # we normalize the head to resolve parent directory symlinks, but not
        # the tail, since we only want to uninstall symlinks, not their targets
        path = os.path.join(normalize_path(head), os.path.normcase(tail))

        if not os.path.exists(path):
            return
        if self._permitted(path):
            self.paths.add(path)
        else:
            self._refuse.add(path)

        # __pycache__ files can show up after 'installed-files.txt' is created,
        # due to imports
        if os.path.splitext(path)[1] == '.py' and uses_pycache:
            self.add(cache_from_source(path)) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:20,代码来源:req_uninstall.py

示例2: add_pth

# 需要导入模块: from pip import utils [as 别名]
# 或者: from pip.utils import normalize_path [as 别名]
def add_pth(self, pth_file, entry):
        pth_file = normalize_path(pth_file)
        if self._permitted(pth_file):
            if pth_file not in self.pth:
                self.pth[pth_file] = UninstallPthEntries(pth_file)
            self.pth[pth_file].add(entry)
        else:
            self._refuse.add(pth_file) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:10,代码来源:req_uninstall.py


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