Example #1
0
def generate_include_list(venv_base):
    """
    insert correct lib dirs into pythonrc.py
    """
    # load pythonrc.py file
    base = path.dirname(rvirtualenv.__file__)
    f = open(path.join(base, "template", "venv", "pythonrc.py"), "r")
    content = f.read()
    f.close()

    # replace pattern in pythonrc.py file with purelib and platlib
    patrn = "# INSERT LIB DIRS HERE"
    libs = "\n".join(
        map(
            lambda x: "    %s" % x,
            (
                "path.join(base, '%s'), # generated purelib" % get_distutils_schema("")["purelib"][1:],
                "path.join(base, '%s'), # generated platlib" % get_distutils_schema("")["platlib"][1:],
            ),
        )
    )
    content = content.replace(patrn, libs)

    # write it
    f = open(path.join(venv_base, "pythonrc.py"), "w")
    f.write(content)
    f.close()
Example #2
0
def generate_include_list(venv_base):
    '''
    insert correct lib dirs into pythonrc.py
    '''
    # load pythonrc.py file
    base = path.dirname(rvirtualenv.__file__)
    f = open(path.join(base, 'template', 'venv', 'pythonrc.py'), 'r')
    content = f.read()
    f.close()

    # replace pattern in pythonrc.py file with purelib and platlib
    patrn = '# INSERT LIB DIRS HERE'
    libs = '\n'.join(map(lambda x: '    %s' % x, (
        "path.join(base, '%s'), # generated purelib" % get_distutils_schema('')['purelib'][1:],
        "path.join(base, '%s'), # generated platlib" % get_distutils_schema('')['platlib'][1:],
    )))
    content = content.replace(patrn, libs)

    # write it
    f = open(path.join(venv_base, 'pythonrc.py'), 'w')
    f.write(content)
    f.close()
Example #3
0
def get_script_path(base):
    return get_distutils_schema(base)['scripts']