streaming item iterator that can optionally run a function / filter function on each item (files/dirs)

            Parameters:
                - path          path to iterate on (note: this is called recursively)
                - want_files    True if you want file results in the iteration, False if you don't
                - want_dirs     True if you want directory results in the iteration, False if you don't
                - func          function to run on each (this will cause the return output to expand to a list of tuples)
                - filt          filter function - only iterates on files when filt(absolute_filename) == True

def iteritems(self, path=None, want_files=True, want_dirs=True, func=None, filt=None):
        ''' streaming item iterator that can optionally run a function / filter function on each item (files/dirs)

            Parameters:
                - path          path to iterate on (note: this is called recursively)
                - want_files    True if you want file results in the iteration, False if you don't
                - want_dirs     True if you want directory results in the iteration, False if you don't
                - func          function to run on each (this will cause the return output to expand to a list of tuples)
                - filt          filter function - only iterates on files when filt(absolute_filename) == True
        '''
        if path is None: iter_path = self.path
        else:            iter_path = path

        for f in os.listdir(iter_path):
            if f[0] == '.': continue

            ## f (filename) -> af (absolute filename)
            if self.absolute: af = os.path.abspath( os.path.join(iter_path, f) )
            else:             af = os.path.join(iter_path, f)

            ## filter out stuff we don't want
            if filt and not filt(af): continue

            ## detect broken path strings
            if not os.path.exists(af): raise IOError('bad path: %s' % af)

            ## return our main response
            if ( os.path.isfile(af) and want_files ) or ( os.path.isdir(af) and want_dirs ):
                if self.stripdot and af[:2] == './': af = af[2:]
                if func: yield ( func(af), af )
                else:    yield af

            ## recurse & return for sub-dirs
            if os.path.isdir(af):
                for x in self.iteritems(path       = af,
                                        want_files = want_files,
                                        want_dirs  = want_dirs,
                                        func       = func,
                                        filt       = filt): yield x