當前位置: 首頁>>代碼示例>>Python>>正文


Python compat.uses_pycache方法代碼示例

本文整理匯總了Python中pip.compat.uses_pycache方法的典型用法代碼示例。如果您正苦於以下問題:Python compat.uses_pycache方法的具體用法?Python compat.uses_pycache怎麽用?Python compat.uses_pycache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pip.compat的用法示例。


在下文中一共展示了compat.uses_pycache方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: add

# 需要導入模塊: from pip import compat [as 別名]
# 或者: from pip.compat import uses_pycache [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

# 需要導入模塊: from pip import compat [as 別名]
# 或者: from pip.compat import uses_pycache [as 別名]
def add(self, path):
        path = normalize_path(path, resolve_symlinks=False)
        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:chalasr,項目名稱:Flask-P2P,代碼行數:15,代碼來源:req_uninstall.py

示例3: add

# 需要導入模塊: from pip import compat [as 別名]
# 或者: from pip.compat import uses_pycache [as 別名]
def add(self, path):
        path = normalize_path(path, resolve_symlinks=False)
        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(imp.cache_from_source(path)) 
開發者ID:francelabs,項目名稱:datafari,代碼行數:15,代碼來源:req_uninstall.py


注:本文中的pip.compat.uses_pycache方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。