Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: tools/fix_pythonpath.py

Issue 330423004: Use new common tools in Python scripts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: append Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/add_codereview_message.py ('k') | tools/git-sync-deps » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/fix_pythonpath.py
diff --git a/tools/fix_pythonpath.py b/tools/fix_pythonpath.py
new file mode 100644
index 0000000000000000000000000000000000000000..c84738ac859bc3050692f63eb945125f7898dd69
--- /dev/null
+++ b/tools/fix_pythonpath.py
@@ -0,0 +1,24 @@
+#!/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)
+
« no previous file with comments | « tools/add_codereview_message.py ('k') | tools/git-sync-deps » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698