'Simple generator that returns the names of the directories and files to
test. It extracts the information from the user configured wordlist
parameter.
@yields: (A string with the directory or file name,
a URL object with the dir or file name)'

def _dir_name_generator(self, base_path):

    if self._bf_directories:
        for directory_name in file(self._dir_list):
            directory_name = directory_name.strip()
            if (directory_name and (not directory_name.startswith('#'))):
                try:
                    dir_url = base_path.url_join((directory_name + '/'))
                except ValueError as ve:
                    msg = 'The    "%s"    line    at    "%s"    generated    an    invalid    URL:    %s'
                    om.out.debug((msg % (directory_name, self._dir_list, ve)))
                else:
                    (yield (directory_name, dir_url))
    if self._bf_files:
        for file_name in file(self._file_list):
            file_name = file_name.strip()
            if (file_name and (not file_name.startswith('#'))):
                try:
                    dir_url = base_path.url_join(file_name)
                except ValueError as ve:
                    msg = 'The    "%s"    line    at    "%s"    generated    an    invalid    URL:    %s'
                    om.out.debug((msg % (file_name, self._file_list, ve)))
                else:
                    (yield (file_name, dir_url))
