def find_eggs_in_zip(importer, path_item, only=False):
if importer.archive.endswith('<STR_LIT>'):<EOL><INDENT>return<EOL><DEDENT>metadata = EggMetadata(importer)<EOL>if metadata.has_metadata('<STR_LIT>'):<EOL><INDENT>yield Distribution.from_filename(path_item, metadata=metadata)<EOL><DEDENT>if only:<EOL><INDENT>return<EOL><DEDENT>for subitem in metadata.resource_listdir('<STR_LIT:/>'):<EOL><INDENT>if _is_egg_path(subitem):<EOL><INDENT>subpath = os.path.join(path_item, subitem)<EOL>dists = find_eggs_in_zip(zipimport.zipimporter(subpath), subpath)<EOL>for dist in dists:<EOL><INDENT>yield dist<EOL><DEDENT><DEDENT>elif subitem.lower().endswith('<STR_LIT>'):<EOL><INDENT>subpath = os.path.join(path_item, subitem)<EOL>submeta = EggMetadata(zipimport.zipimporter(subpath))<EOL>submeta.egg_info = subpath<EOL>yield Distribution.from_location(path_item, subitem, submeta)<EOL><DEDENT><DEDENT>
Find eggs in zip files; possibly multiple nested eggs.