389c8e9d2d
if a filename ends with `.py` and the file begins with '#!.*python.*', make it executable. Change-Id: I41de516ff37343d3b0979bde9fd61813aec7365c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254439 Commit-Queue: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner <bungeman@google.com> Auto-Submit: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
25 lines
539 B
Python
Executable File
25 lines
539 B
Python
Executable File
#!/usr/bin/env python
|
|
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
|
|
"""Add the checkout root to sys.path, provide mechanisms for adding others."""
|
|
|
|
|
|
import os
|
|
import sys
|
|
|
|
|
|
CHECKOUT_ROOT = os.path.realpath(os.path.join(
|
|
os.path.dirname(os.path.abspath(__file__)), os.pardir))
|
|
|
|
|
|
def add_to_pythonpath(path):
|
|
"""Add the given directory to PYTHONPATH."""
|
|
sys.path.append(path)
|
|
|
|
|
|
add_to_pythonpath(CHECKOUT_ROOT)
|
|
|