def sprinter(self):
        """
        Called when parallelize is True.
        This function will generate the file names in a directory tree by adding directories to a Queue and
        continuously exploring directories in the Queue until Queue is emptied.
        Significantly faster than crawler method for larger directory trees.
        """
        self._printer('Multiprocess Walk')
        # Loop through directories in case there is more than one (1)
        for directory in self.directory:
            self._get_root_files(directory)  # Add file within root directory if filepaths is empty
            # acquire the list of paths
            first_level_dirs = next(os.walk(directory))[1]
            for path in first_level_dirs:
                self.unsearched.put((directory, path))
        self._printer('Pool Processing STARTED')
        pool = Pool(self.pool_size)
        pool.map_async(self.parallel_worker, range(self.pool_size))
        pool.close()
        self.unsearched.join()
        self._printer('Pool Processing ENDED')
        return self.filepaths
def sprinter ( self ) : self . _printer ( 'Multiprocess Walk' ) for directory in self . directory : self . _get_root_files ( directory ) first_level_dirs = next ( os . walk ( directory ) ) [ 1 ] for path in first_level_dirs : self . unsearched . put ( ( directory , path ) ) self . _printer ( 'Pool Processing STARTED' ) pool = Pool ( self . pool_size ) pool . map_async ( self . parallel_worker , range ( self . pool_size ) ) pool . close ( ) self . unsearched . join ( ) self . _printer ( 'Pool Processing ENDED' ) return self . filepaths
Called when parallelize is True.
        This function will generate the file names in a directory tree by adding directories to a Queue and
        continuously exploring directories in the Queue until Queue is emptied.
        Significantly faster than crawler method for larger directory trees.