예제 #1
0
파일: pew.py 프로젝트: alimuldal/pew
def makedirs_and_symlink_if_needed(workon_home):
    if not workon_home.exists() and own(workon_home):
        workon_home.mkdir(parents=True)
        link = expandpath('~/.virtualenvs')
        if os.name == 'posix' and 'WORKON_HOME' not in os.environ and \
           'XDG_DATA_HOME' not in os.environ and not link.exists():
            link.symlink_to(str(workon_home))
        return True
    else:
        return False
예제 #2
0
파일: pew.py 프로젝트: aranega/pew
def makedirs_and_symlink_if_needed(workon_home):
    if not workon_home.exists() and own(workon_home):
        workon_home.mkdir(parents=True)
        link = expandpath('~/.virtualenvs')
        if os.name == 'posix' and 'WORKON_HOME' not in os.environ and \
           'XDG_DATA_HOME' not in os.environ and not link.exists():
             link.symlink_to(str(workon_home))
        return True
    else:
        return False
예제 #3
0
파일: pew.py 프로젝트: jlesquembre/pew
def makedirs_and_symlink_if_needed(workon_home):
    if not workon_home.exists() and own(workon_home):
        workon_home.mkdir(parents=True)
        link = expandpath('~/.virtualenvs')
        if os.name == 'posix' and 'WORKON_HOME' not in os.environ and \
           'XDG_DATA_HOME' not in os.environ and not link.exists():
            try:
                workon_home.symlink_to(str(link))
            except OSError as e:
                # FIXME on TravisCI, even if I check with `link.exists()`, this
                # exception can be raised and needs to be catched, maybe it's a race condition?
                if e.errno != 17:
                    raise
예제 #4
0
파일: pew.py 프로젝트: jck/pew
def makedirs_and_symlink_if_needed(workon_home):
    if not workon_home.exists() and own(workon_home):
        workon_home.mkdir(parents=True)
        link = expandpath('~/.virtualenvs')
        if os.name == 'posix' and 'WORKON_HOME' not in os.environ and \
           'XDG_DATA_HOME' not in os.environ and not link.exists():
            try:
                workon_home.symlink_to(str(link))
            except OSError as e:
                # FIXME on TravisCI, even if I check with `link.exists()`, this
                # exception can be raised and needs to be catched, maybe it's a race condition?
                if e.errno != 17:
                    raise
예제 #5
0
파일: pew.py 프로젝트: berdario/pew
def makedirs_and_symlink_if_needed(workon_home):
    if not workon_home.exists() and own(workon_home):
        workon_home.mkdir(parents=True)
        link = expandpath("~/.virtualenvs")
        if (
            os.name == "posix"
            and "WORKON_HOME" not in os.environ
            and "XDG_DATA_HOME" not in os.environ
            and not link.exists()
        ):
            link.symlink_to(str(workon_home))
        return True
    else:
        return False