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 subitem.endswith('<STR_LIT>'):<EOL><INDENT>subpath = os.path.join(path_item, subitem)<EOL>for dist in find_eggs_in_zip(zipimport.zipimporter(subpath), subpath):<EOL><INDENT>yield dist<EOL><DEDENT><DEDENT><DEDENT>
Find eggs in zip files; possibly multiple nested eggs.