diff options
author | Chris Schlaeger <chris@linux.com> | 2014-08-12 21:56:44 +0200 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2014-08-12 21:56:44 +0200 |
commit | ea346a785dc1b3f7c156f6fc33da634e1f1a627b (patch) | |
tree | af67530553d20b6e82ad60fd79593e9c4abf5565 /misc/openlayers/tools/oldot.py | |
parent | 59741cd535c47f25971bf8c32b25da25ceadc6d5 (diff) | |
download | postrunner-ea346a785dc1b3f7c156f6fc33da634e1f1a627b.zip |
Adding jquery, flot and openlayers to be included with the GEM.v0.0.4
Diffstat (limited to 'misc/openlayers/tools/oldot.py')
-rw-r--r-- | misc/openlayers/tools/oldot.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/misc/openlayers/tools/oldot.py b/misc/openlayers/tools/oldot.py new file mode 100644 index 0000000..396fb17 --- /dev/null +++ b/misc/openlayers/tools/oldot.py @@ -0,0 +1,43 @@ +import re +import os +def run(): + sourceDirectory = "../lib/OpenLayers" + allFiles = [] + SUFFIX_JAVASCRIPT = ".js" + ## Find all the Javascript source files + for root, dirs, files in os.walk(sourceDirectory): + for filename in files: + if filename.endswith(SUFFIX_JAVASCRIPT) and not filename.startswith("."): + filepath = os.path.join(root, filename)[len(sourceDirectory)+1:] + filepath = filepath.replace("\\", "/") + data = open(os.path.join(sourceDirectory, filepath)).read() + parents = re.search("OpenLayers.Class\((.*?){", data, + re.DOTALL) + if parents: + parents = [x.strip() for x in parents.group(1).strip().strip(",").split(",")] + else: + parents = [] + cls = "OpenLayers.%s" % filepath.strip(".js").replace("/", ".") + allFiles.append([cls, parents]) + return allFiles +print """ +digraph name { + fontname = "Helvetica" + fontsize = 8 + K = 0.6 + + node [ + fontname = "Helvetica" + fontsize = 8 + shape = "plaintext" + ] +""" + +for i in run(): + print i[0].replace(".", "_") + for item in i[1]: + if not item: continue + print "%s -> %s" % (i[0].replace(".","_"), item.replace(".", "_")) + print "; " + +print """}""" |