def _build_module_list(source_module, index_filename, ignore_modules):
out = []<EOL>dirs_with_init = set()<EOL>module_prefix = '<STR_LIT>' if source_module == '<STR_LIT:.>' else source_module<EOL>for root, _, filenames in walk('<STR_LIT:.>'):<EOL><INDENT>root = root[<NUM_LIT:2>:]<EOL>module_root = root.replace('<STR_LIT:/>', '<STR_LIT:.>')<EOL>file_names = [filename[:-<NUM_LIT:3>] for filename in filenames if filename.endswith('<STR_LIT>')]<EOL>for filename in file_names:<EOL><INDENT>if filename == '<STR_LIT>':<EOL><INDENT>dirs_with_init.add(root)<EOL>module_name = '<STR_LIT:.>'.join([module_prefix, module_root]) if module_root else source_module<EOL><DEDENT>elif not root:<EOL><INDENT>module_name = '<STR_LIT:.>'.join([module_prefix, filename])<EOL><DEDENT>else:<EOL><INDENT>module_name = '<STR_LIT:.>'.join([module_prefix, root.replace('<STR_LIT:/>', '<STR_LIT:.>'), filename])<EOL><DEDENT>if module_name.startswith('<STR_LIT:.>'):<EOL><INDENT>module_name = module_name[<NUM_LIT:1>:]<EOL><DEDENT>if module_name in ignore_modules:<EOL><INDENT>print('<STR_LIT>'.format('<STR_LIT>'.format(root), filename))<EOL>continue<EOL><DEDENT>if root and root not in dirs_with_init:<EOL><INDENT>print('<STR_LIT>'.format('<STR_LIT>'.format(root), filename))<EOL>continue<EOL><DEDENT>source_name = '<STR_LIT>'.format(filename)<EOL>if root:<EOL><INDENT>source_name = '<STR_LIT>'.format(root, source_name)<EOL><DEDENT>if filename == '<STR_LIT>':<EOL><INDENT>output_name = '<STR_LIT>'.format(index_filename)<EOL><DEDENT>else:<EOL><INDENT>output_name = '<STR_LIT>'.format(filename)<EOL><DEDENT>if root:<EOL><INDENT>output_name = '<STR_LIT>'.format(root, output_name)<EOL><DEDENT>out.append({<EOL>'<STR_LIT>': root,<EOL>'<STR_LIT:file>': filename,<EOL>'<STR_LIT>': module_name,<EOL>'<STR_LIT>': output_name,<EOL>'<STR_LIT:source>': source_name<EOL>})<EOL><DEDENT><DEDENT>return out<EOL>
Builds a list of python modules in the current directory.