def classpath_entries_contents(cls, classpath_entries):
    """Provide a generator over the contents (classes/resources) of a classpath.

    Subdirectories are included and differentiated via a trailing forward slash (for symmetry
    across ZipFile.namelist and directory walks).

    :param classpath_entries: A sequence of classpath_entries. Non-jars/dirs are ignored.
    :returns: An iterator over all classpath contents, one directory, class or resource relative
              path per iteration step.
    :rtype: :class:`collections.Iterator` of string
    """
    for entry in classpath_entries:
      if cls.is_jar(entry):
        # Walk the jar namelist.
        with open_zip(entry, mode='r') as jar:
          for name in jar.namelist():
            yield ensure_text(name)
      elif os.path.isdir(entry):
        # Walk the directory, including subdirs.
        def rel_walk_name(abs_sub_dir, name):
          return fast_relpath(os.path.join(abs_sub_dir, name), entry)
        for abs_sub_dir, dirnames, filenames in safe_walk(entry):
          for name in dirnames:
            yield '{}/'.format(rel_walk_name(abs_sub_dir, name))
          for name in filenames:
            yield rel_walk_name(abs_sub_dir, name)
      else:
        # non-jar and non-directory classpath entries should be ignored
        pass
def classpath_entries_contents ( cls , classpath_entries ) : for entry in classpath_entries : if cls . is_jar ( entry ) : with open_zip ( entry , mode = 'r' ) as jar : for name in jar . namelist ( ) : yield ensure_text ( name ) elif os . path . isdir ( entry ) : def rel_walk_name ( abs_sub_dir , name ) : return fast_relpath ( os . path . join ( abs_sub_dir , name ) , entry ) for abs_sub_dir , dirnames , filenames in safe_walk ( entry ) : for name in dirnames : yield '{}/' . format ( rel_walk_name ( abs_sub_dir , name ) ) for name in filenames : yield rel_walk_name ( abs_sub_dir , name ) else : pass
Provide a generator over the contents (classes/resources) of a classpath.

    Subdirectories are included and differentiated via a trailing forward slash (for symmetry
    across ZipFile.namelist and directory walks).

    :param classpath_entries: A sequence of classpath_entries. Non-jars/dirs are ignored.
    :returns: An iterator over all classpath contents, one directory, class or resource relative
              path per iteration step.
    :rtype: :class:`collections.Iterator` of string