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

Side by Side Diff: systrace/systrace/__init__.py

Issue 1776013005: [DO NOT COMMIT] Refactor systrace to support new clock sync design (Closed) Base URL: git@github.com:catapult-project/catapult@master
Patch Set: fix categories issue Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « systrace/bin/systrace ('k') | systrace/systrace/agents/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 import os
5 import sys
6
7 def _JoinPath(*path_parts):
8 return os.path.abspath(os.path.join(*path_parts))
9
10
11 def _AddDirToPythonPath(*path_parts):
12 path = _JoinPath(*path_parts)
13 if os.path.isdir(path) and path not in sys.path:
14 # Some call sites that use Telemetry assume that sys.path[0] is the
15 # directory containing the script, so we add these extra paths to right
16 # after sys.path[0].
17 sys.path.insert(1, path)
18
19 _CATAPULT_DIR = os.path.join(
20 os.path.dirname(os.path.abspath(__file__)), os.path.pardir, os.path.pardir)
21
22 _AddDirToPythonPath(_CATAPULT_DIR, 'catapult_base')
23 _AddDirToPythonPath(_CATAPULT_DIR, 'devil')
24 _AddDirToPythonPath(_CATAPULT_DIR, 'systrace')
25 _AddDirToPythonPath(_CATAPULT_DIR, 'common', 'py_trace_event')
26 _AddDirToPythonPath(_CATAPULT_DIR, 'common', 'py_trace_event', 'py_trace_event')
OLDNEW
« no previous file with comments | « systrace/bin/systrace ('k') | systrace/systrace/agents/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698