[Python-checkins] python/nondist/sandbox/setuptools pkg_resources.py, 1.21, 1.22

pje@users.sourceforge.net pje at users.sourceforge.net
Sun May 29 07:21:02 CEST 2005


Update of /cvsroot/python/python/nondist/sandbox/setuptools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23732

Modified Files:
	pkg_resources.py 
Log Message:
Correctly recognize .egg files that are already on sys.path (or whatever
path AvailableDistributions is scanning)


Index: pkg_resources.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/pkg_resources.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- pkg_resources.py	29 May 2005 00:17:22 -0000	1.21
+++ pkg_resources.py	29 May 2005 05:20:59 -0000	1.22
@@ -755,6 +755,15 @@
     return finder(importer,path_item)
 
 
+def find_in_zip(importer,path_item):
+    # for now, we only yield the .egg file itself, if applicable; 
+    # i.e., we don't support "baskets" yet, just eggs
+    for item in find_on_path(importer,path_item):
+        yield item
+
+register_finder(zipimport.zipimporter,find_in_zip)
+
+
 def StringIO(*args, **kw):
     """Thunk to load the real StringIO on demand"""
     global StringIO
@@ -770,13 +779,6 @@
 
 
 
-
-
-
-
-
-
-
 def find_nothing(importer,path_item):
     return ()
 



More information about the Python-checkins mailing list