@@ -0,0 +1,1057 @@
+# Link in a module in the global Python site-packages the virtualenv that we are currently in%0A# Author: Luke Macken %3Clmacken@redhat.com%3E%0A%0Aimport os%0Aimport sys%0A%0Afrom glob import glob%0Afrom distutils.sysconfig import get_python_lib%0A%0Adef symlink_global_module_into_virtualenv(modulename, env):%0A    for path in (get_python_lib(), get_python_lib(1)):%0A        for modpath in glob(os.path.join(path, modulename) + '*'):%0A            dest = os.path.join(env, path.replace('/usr/', ''), os.path.basename(modpath))%0A            if os.path.exists(dest):%0A                assert os.path.islink(dest)%0A            else:%0A                print %22%25s =%3E %25s%22 %25 (modpath, dest)%0A                os.symlink(modpath, dest)%0A%0Aif __name__ == '__main__':%0A    if len(sys.argv) != 3:%0A        print %22Usage: %25s %3Cvirtualenv%3E %3Cmodulename%3E%22 %25 sys.argv%5B0%5D%0A        sys.exit(2)%0A%0A    env = os.environ.get('VIRTUAL_ENV')%0A    if env:%0A        print %22You must deactivate your virtualenv first%22%0A        sys.exit(1)%0A%0A    prog, env, module = sys.argv%0A%0A    symlink_global_module_into_virtualenv(module, env)%0A

Add a tool for linking in global python modules into our virtualenv