def getIndex(folderPath=None):
try:    return cache.structure<EOL>except AttributeError: pass <EOL>if folderPath == None:<EOL><INDENT>from sc2maptool.startup import setup<EOL>folderPath = setup()<EOL><DEDENT>def folderSearch(path, attrList=[]):<EOL><INDENT>ret = []<EOL>for item in glob(os.path.join(path, '<STR_LIT:*>')):<EOL><INDENT>if item == os.sep: continue<EOL>itemName = os.path.basename(item)<EOL>if   os.path.isdir(item):               ret += folderSearch(item, attrList + [itemName])<EOL>elif itemName.endswith(c.SC2_MAP_EXT):  ret.append( MapRecord(itemName, item, attrList) )<EOL><DEDENT>return ret<EOL><DEDENT>cache.structure = folderSearch(folderPath)<EOL>return cache.structure<EOL>
parse the 'Maps' subfolder directory divining criteria for valid maps