OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/python2.4 |
| 2 # Copyright 2009 Google Inc. |
| 3 # |
| 4 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 # you may not use this file except in compliance with the License. |
| 6 # You may obtain a copy of the License at |
| 7 # |
| 8 # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 # |
| 10 # Unless required by applicable law or agreed to in writing, software |
| 11 # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 # See the License for the specific language governing permissions and |
| 14 # limitations under the License. |
| 15 |
| 16 # This file is just here so that we can modify the python path before |
| 17 # invoking nixysa. |
| 18 |
| 19 import subprocess |
| 20 import sys |
| 21 import os |
| 22 import os.path |
| 23 |
| 24 third_party = os.path.join('..', '..', '..', 'third_party') |
| 25 pythonpath = os.pathsep.join([os.path.join(third_party, 'gflags', 'python'), |
| 26 os.path.join(third_party, 'ply', 'files')]) |
| 27 |
| 28 orig_pythonpath = os.environ.get('PYTHONPATH') |
| 29 if orig_pythonpath: |
| 30 pythonpath = os.pathsep.join([pythonpath, orig_pythonpath]) |
| 31 |
| 32 os.environ['PYTHONPATH'] = pythonpath |
| 33 |
| 34 nixysa = os.path.join(third_party, 'nixysa', 'files', 'codegen.py') |
| 35 status = subprocess.call([sys.executable, nixysa] + sys.argv[1:]) |
| 36 sys.exit(status) |
OLD | NEW |