예제 #1
0
from winsys import registry, environment

def munge_path(env, python_paths):
    #env['PATH'] =
    print ";".join(
        p for p in env['PATH'].split(";") if not any(
            p.lower().startswith(py) for py in python_paths
        )
    )

py = registry.registry(r"hklm\software\python\pythoncore")
py_paths = set(version.InstallPath.get_value("").rstrip("\\").lower() for version in py)
py = registry.registry(r"hkcu\software\python\pythoncore")
py_paths.update(version.InstallPath.get_value("").rstrip("\\").lower() for version in py)

munge_path(environment.user(), py_paths)
munge_path(environment.system(), py_paths)
예제 #2
0
 def test_system_environment(self):
     self.assertTrue(environment.system())
예제 #3
0
from winsys import registry, environment


def munge_path(env, python_paths):
    #env['PATH'] =
    print ";".join(p for p in env['PATH'].split(";")
                   if not any(p.lower().startswith(py) for py in python_paths))


py = registry.registry(r"hklm\software\python\pythoncore")
py_paths = set(
    version.InstallPath.get_value("").rstrip("\\").lower() for version in py)
py = registry.registry(r"hkcu\software\python\pythoncore")
py_paths.update(
    version.InstallPath.get_value("").rstrip("\\").lower() for version in py)

munge_path(environment.user(), py_paths)
munge_path(environment.system(), py_paths)
def _set_python_in_path(version):
	paths = _get_python_paths(exclude=version)
	env = environment.system()
	_remove_from_path(env, paths)
	python27path = _get_python_paths(include=version)[0]
	_add_to_path(env, python27path)
예제 #5
0
 def test_system_environment(self):
     self.assertTrue(environment.system())