Exemplo n.º 1
0
Arquivo: pew.py Projeto: 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
Exemplo n.º 2
0
Arquivo: pew.py Projeto: 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
Exemplo n.º 3
0
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
Exemplo n.º 4
0
Arquivo: pew.py Projeto: 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
Exemplo n.º 5
0
Arquivo: pew.py Projeto: 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