Mercurial > hg > truffle
annotate pytools/gl @ 3709:54915831e565
IdealGraphVisualizer: add filter for Graal Call Analysis graphs
author | Peter Hofer <peter.hofer@jku.at> |
---|---|
date | Mon, 05 Dec 2011 20:00:57 +0100 |
parents | 9878f53ebe09 |
children |
rev | line source |
---|---|
3689
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 #!/bin/bash |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 dir=`/bin/pwd` |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 while [ ! \( -f "$dir/pytools/gl.py" -a -f "$dir/GRAAL_README" \) ]; do |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 dir="$(dirname $dir)" |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 if [ "$dir" = "/" ]; then |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 echo "Cannot find 'pytools/gl.py' in `/bin/pwd` or any of it's parents" |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 exit 1 |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 fi |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 done |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 python <<END |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 import sys |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 major, minor, micro, _, _ = sys.version_info |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 if major != 2 or minor != 7: |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 raise SystemExit('The gl.py script requires Python 2.7, not {0}.{1}.{2}'.format(major, minor, micro)) |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 END |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 if [ $? -eq 0 ]; then |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 exec python "$dir/pytools/gl.py" "$@" |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 fi |
9878f53ebe09
Added helper script for gl.py.
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 |