python类running_under_virtualenv()的实例源码

outdated.py 文件源码 项目:RealtimePythonChat 作者: quangtqag 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:Indushell 作者: SecarmaLabs 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:SHAREOpenRefineWkshop 作者: cmh2166 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:Liljimbo-Chatbot 作者: chrisjim316 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:leetcode 作者: thomasyimgit 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:flask_system 作者: prashasy 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:news-for-good 作者: thecodinghub 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:CaScale 作者: Thatsillogical 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
util.py 文件源码 项目:chihu 作者: yelongyu 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def is_local(path):
    """
    Return True if path is within sys.prefix, if we're running in a virtualenv.

    If we're not in a virtualenv, all paths are considered "local."

    """
    if not running_under_virtualenv():
        return True
    return normalize_path(path).startswith(normalize_path(sys.prefix))
util.py 文件源码 项目:chihu 作者: yelongyu 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def egg_link_path(dist):
    """
    Return the path for the .egg-link file if it exists, otherwise, None.

    There's 3 scenarios:
    1) not in a virtualenv
       try to find in site.USER_SITE, then site_packages
    2) in a no-global virtualenv
       try to find in site_packages
    3) in a yes-global virtualenv
       try to find in site_packages, then site.USER_SITE  (don't look in global location)

    For #1 and #3, there could be odd cases, where there's an egg-link in 2 locations.
    This method will just return the first one found.
    """
    sites = []
    if running_under_virtualenv():
        if virtualenv_no_global():
            sites.append(site_packages)
        else:
            sites.append(site_packages)
            if user_site:
                sites.append(user_site)
    else:
        if user_site:
            sites.append(user_site)
        sites.append(site_packages)

    for site in sites:
        egglink = os.path.join(site, dist.project_name) + '.egg-link'
        if os.path.isfile(egglink):
            return egglink
outdated.py 文件源码 项目:ShelbySearch 作者: Agentscreech 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:where2live 作者: fbessez 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:pyetje 作者: rorlika 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:respeaker_virtualenv 作者: respeaker 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
util.py 文件源码 项目:krpcScripts 作者: jwvanderbeck 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def is_local(path):
    """
    Return True if path is within sys.prefix, if we're running in a virtualenv.

    If we're not in a virtualenv, all paths are considered "local."

    """
    if not running_under_virtualenv():
        return True
    return normalize_path(path).startswith(normalize_path(sys.prefix))
util.py 文件源码 项目:krpcScripts 作者: jwvanderbeck 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def egg_link_path(dist):
    """
    Return the path for the .egg-link file if it exists, otherwise, None.

    There's 3 scenarios:
    1) not in a virtualenv
       try to find in site.USER_SITE, then site_packages
    2) in a no-global virtualenv
       try to find in site_packages
    3) in a yes-global virtualenv
       try to find in site_packages, then site.USER_SITE  (don't look in global location)

    For #1 and #3, there could be odd cases, where there's an egg-link in 2 locations.
    This method will just return the first one found.
    """
    sites = []
    if running_under_virtualenv():
        if virtualenv_no_global():
            sites.append(site_packages)
        else:
            sites.append(site_packages)
            if user_site:
                sites.append(user_site)
    else:
        if user_site:
            sites.append(user_site)
        sites.append(site_packages)

    for site in sites:
        egglink = os.path.join(site, dist.project_name) + '.egg-link'
        if os.path.isfile(egglink):
            return egglink
outdated.py 文件源码 项目:Tencent_Cartoon_Download 作者: Fretice 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:Problematica-public 作者: TechMaz 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:bawk 作者: jttwnsnd 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()
outdated.py 文件源码 项目:infinite-lorem-ipsum 作者: patjm1992 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def load_selfcheck_statefile():
    if running_under_virtualenv():
        return VirtualenvSelfCheckState()
    else:
        return GlobalSelfCheckState()


问题


面经


文章

微信
公众号

扫码关注公众号