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

Unified Diff: appengine/findit/util_scripts/script_util.py

Issue 2391823006: [Findit] Add iterator and crash_iterator for delta test (Closed)
Patch Set: Update doc strings. Created 4 years, 2 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 | « appengine/findit/util_scripts/remote_api.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/util_scripts/script_util.py
diff --git a/appengine/findit/util_scripts/script_util.py b/appengine/findit/util_scripts/script_util.py
new file mode 100644
index 0000000000000000000000000000000000000000..1d9846d437f3a7cb4731b5c728d05b11631c2e02
--- /dev/null
+++ b/appengine/findit/util_scripts/script_util.py
@@ -0,0 +1,27 @@
+# Copyright 2016 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.
+
+"""This module contains util functions that local scripts can use."""
+
+import os
+import sys
+
+
+def SetUpSystemPaths():
+ """Sets system paths so as to import modules in findit, third_party and
+ appengine."""
+ findit_root_dir = os.path.join(os.path.dirname(__file__), os.path.pardir)
+ third_party_dir = os.path.join(findit_root_dir, 'third_party')
+ appengine_sdk_dir = os.path.join(findit_root_dir, os.path.pardir,
+ os.path.pardir, os.path.pardir,
+ 'google_appengine')
+
+ # Add App Engine SDK dir to sys.path.
+ sys.path.insert(1, appengine_sdk_dir)
+ sys.path.insert(1, third_party_dir)
+ import dev_appserver
+ dev_appserver.fix_sys_path()
+
+ # Add Findit root dir to sys.path so that modules in Findit is available.
+ sys.path.insert(1, findit_root_dir)
« no previous file with comments | « appengine/findit/util_scripts/remote_api.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698