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

Unified Diff: tools/metrics/histograms/pretty_print.py

Issue 163473008: Make pretty_print.py look for a histograms.xml in the current working directory first. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/metrics/histograms/pretty_print.py
diff --git a/tools/metrics/histograms/pretty_print.py b/tools/metrics/histograms/pretty_print.py
index 60e8c7833e59e5f0020d3188881526e0fe462385..bde97fdfbf3ee11e983a50e990cf8a9e80cea678 100755
--- a/tools/metrics/histograms/pretty_print.py
+++ b/tools/metrics/histograms/pretty_print.py
@@ -322,13 +322,17 @@ def main():
histograms_filename = 'histograms.xml'
histograms_backup_filename = 'histograms.before.pretty-print.xml'
- script_dir = path_utils.ScriptDir()
-
- histograms_pathname = os.path.join(script_dir, histograms_filename)
- histograms_backup_pathname = os.path.join(script_dir,
+ # If there is a histograms.xml in the current working directory, use that.
+ # Otherwise, use the one residing in the same directory as this script.
+ histograms_dir = os.getcwd()
+ if not os.path.isfile(os.path.join(histograms_dir, histograms_filename)):
+ histograms_dir = path_utils.ScriptDir()
+
+ histograms_pathname = os.path.join(histograms_dir, histograms_filename)
+ histograms_backup_pathname = os.path.join(histograms_dir,
histograms_backup_filename)
- logging.info('Loading %s...' % histograms_filename)
+ logging.info('Loading %s...' % os.path.relpath(histograms_pathname))
with open(histograms_pathname, 'rb') as f:
xml = f.read()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698