4 sourceDirectory = "../lib/OpenLayers"
6 SUFFIX_JAVASCRIPT = ".js"
7 ## Find all the Javascript source files
8 for root, dirs, files in os.walk(sourceDirectory):
10 if filename.endswith(SUFFIX_JAVASCRIPT) and not filename.startswith("."):
11 filepath = os.path.join(root, filename)[len(sourceDirectory)+1:]
12 filepath = filepath.replace("\\", "/")
13 data = open(os.path.join(sourceDirectory, filepath)).read()
14 parents = re.search("OpenLayers.Class\((.*?){", data,
17 parents = [x.strip() for x in parents.group(1).strip().strip(",").split(",")]
20 cls = "OpenLayers.%s" % filepath.strip(".js").replace("/", ".")
21 allFiles.append([cls, parents])
25 fontname = "Helvetica"
30 fontname = "Helvetica"
37 print i[0].replace(".", "_")
40 print "%s -> %s" % (i[0].replace(".","_"), item.replace(".", "_"))