'Return an iterator which yields the paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la fnmatch.'

def iglob(self, pathname):

    if (not glob.has_magic(pathname)):
        if self.ssh.lpath_exists(pathname):
            (yield pathname)
        return
    (dirname, basename) = posixpath.split(pathname)
    if (not dirname):
        for name in self.glob1(posixpath.curdir, basename):
            (yield name)
        return
    if glob.has_magic(dirname):
        dirs = self.iglob(dirname)
    else:
        dirs = [dirname]
    if glob.has_magic(basename):
        glob_in_dir = self.glob1
    else:
        glob_in_dir = self.glob0
    for dirname in dirs:
        for name in glob_in_dir(dirname, basename):
            (yield posixpath.join(dirname, name))
