oldot.py
Go to the documentation of this file.
00001 import re
00002 import os    
00003 def run():
00004     sourceDirectory = "../lib/OpenLayers"    
00005     allFiles = []
00006     SUFFIX_JAVASCRIPT = ".js"
00007     ## Find all the Javascript source files
00008     for root, dirs, files in os.walk(sourceDirectory):
00009         for filename in files:
00010             if filename.endswith(SUFFIX_JAVASCRIPT) and not filename.startswith("."):
00011                 filepath = os.path.join(root, filename)[len(sourceDirectory)+1:]
00012                 filepath = filepath.replace("\\", "/")
00013                 data = open(os.path.join(sourceDirectory, filepath)).read()
00014                 parents = re.search("OpenLayers.Class\((.*?){", data, 
00015                       re.DOTALL)
00016                 if parents:
00017                     parents = [x.strip() for x in parents.group(1).strip().strip(",").split(",")]
00018                 else: 
00019                     parents = []
00020                 cls = "OpenLayers.%s" % filepath.strip(".js").replace("/", ".")
00021                 allFiles.append([cls, parents])
00022     return allFiles
00023 print """
00024 digraph name {
00025   fontname = "Helvetica"
00026   fontsize = 8
00027   K = 0.6
00028 
00029   node [
00030     fontname = "Helvetica"
00031     fontsize = 8
00032     shape = "plaintext"
00033   ]
00034 """
00035 
00036 for i in run():
00037     print i[0].replace(".", "_")
00038     for item in i[1]:
00039         if not item: continue
00040         print "%s -> %s" % (i[0].replace(".","_"), item.replace(".", "_"))
00041     print "; "
00042 
00043 print """}"""


websocket_gui
Author(s): Benoit Lescot and Stéphane Magnenat
autogenerated on Sat Dec 28 2013 17:46:48