'Loop over the modules present below this entry or package on PYTHONPATH.
For modules which are not packages, this will yield nothing.
For packages and path entries, this will only yield modules one level
down; i.e. if there is a package a.b.c, iterModules on a will only
return a.b.  If you want to descend deeply, use walkModules.
@return: a generator which yields PythonModule instances that describe
modules which can be, or have been, imported.'

def iterModules(self):

    yielded = {}
    if (not self.filePath.exists()):
        return
    for placeToLook in self._packagePaths():
        try:
            children = sorted(placeToLook.children())
        except UnlistableError:
            continue
        for potentialTopLevel in children:
            ext = potentialTopLevel.splitext()[1]
            potentialBasename = potentialTopLevel.basename()[:(- len(ext))]
            if (ext in PYTHON_EXTENSIONS):
                if (not _isPythonIdentifier(potentialBasename)):
                    continue
                modname = self._subModuleName(potentialBasename)
                if (modname.split('.')[(-1)] == '__init__'):
                    continue
                if (modname not in yielded):
                    yielded[modname] = True
                    pm = PythonModule(modname, potentialTopLevel, self._getEntry())
                    assert (pm != self)
                    (yield pm)
            else:
                if (ext or (not _isPythonIdentifier(potentialBasename)) or (not potentialTopLevel.isdir())):
                    continue
                modname = self._subModuleName(potentialTopLevel.basename())
                for ext in PYTHON_EXTENSIONS:
                    initpy = potentialTopLevel.child(('__init__' + ext))
                    if (initpy.exists() and (modname not in yielded)):
                        yielded[modname] = True
                        pm = PythonModule(modname, initpy, self._getEntry())
                        assert (pm != self)
                        (yield pm)
                        break
