diff options
author | Alon Zakai <azakai@mozilla.com> | 2011-01-14 22:44:52 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2011-01-14 22:44:52 -0800 |
commit | 9d209878f9819ffd1aa92c7306123392609db845 (patch) | |
tree | 2a6093cc6ce7fce34ea2a0473a639388b0a37d4e /third_party | |
parent | 60122ddc2e157b1cf117e6e098a2fc336c92d5a7 (diff) |
refactor shared components of python tools, and add emmaken.py
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/demangler.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/third_party/demangler.py b/third_party/demangler.py index b9b4b1ef..f3407825 100644 --- a/third_party/demangler.py +++ b/third_party/demangler.py @@ -21,8 +21,10 @@ JS_ENGINE_PARAMS=[] import os, sys, subprocess -CONFIG_FILE = os.path.expanduser('~/.emscripten') -exec(open(CONFIG_FILE, 'r').read()) +abspath = os.path.abspath(os.path.dirname(__file__)) +def path_from_root(*pathelems): + return os.path.join(os.path.sep, *(abspath.split(os.sep)[:-1] + list(pathelems))) +exec(open(path_from_root('tools', 'shared.py'), 'r').read()) data = open(sys.argv[1], 'r').readlines() splitter = sys.argv[2] @@ -35,8 +37,7 @@ for line in data: func = line.lstrip().split(splitter)[0] if func in SEEN: continue SEEN[func] = True - args = JS_ENGINE + [os.path.join(os.path.dirname(__file__), 'gcc_demangler.js')] + JS_ENGINE_PARAMS + [func[1:]] - cleaned = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0] + cleaned = run_js(JS_ENGINE, path_from_root('third_party', 'gcc_demangler.js'), [func[1:]]) if cleaned is None: continue if 'Fatal exception' in cleaned: continue cleaned = cleaned[1:-2] |