#!/usr/bin/env python

import sys
from os.path import join, dirname, exists

# Use the local preprocess.py if we are in the source tree.
source_tree_script = join(dirname(__file__), "..", "lib", "preprocess.py")
if exists(source_tree_script):
    sys.path.insert(0, dirname(source_tree_script))
    try:
        from preprocess import main
    finally:
        del sys.path[0]
else:
    from preprocess import main

if __name__ == "__main__":
    sys.exit( main(sys.argv) )
