[Distutils] Packages listed in Easy-Install.pth

David Lyon david.lyon at preisshare.net
Tue Mar 10 04:19:27 CET 2009


Hi All,

I am doing some grubby work on the Python Package Manager project.
http://sourceforge.net/projects/pythonpkgmgr/

After running and installing some packages.. with EasyInstall, my
Easy-Install.pth
file gets filled with the package and egg names.

What I want to do is use these in a list of installed packages. And then
later provide for deinstallation. I'm thinking of parsing this file to read
all the package names..

My question is is there any way to do the same thing with setuptools?
Forgive my ignorance - I am just hacking the code. :-)

---c:\python25\lib\site-packages\Easy-Install.pth-----------------------------
import sys; sys.__plen = len(sys.path)
./setuptools-0.6c9-py2.5.egg
./xmlmp-1.1-py2.5.egg
./xml2ddl-0.3.1-py2.5.egg
./xml_compare-1.0.5-py2.5.egg
./html5lib-0.11.1-py2.5.egg
./html2text-2.35-py2.5.egg
import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:];
p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert =
p+len(new)

-------------------------------------------------------------------------------

Regards

David





More information about the Distutils-SIG mailing list