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

Unified Diff: tools/telemetry/telemetry/__init__.py

Issue 205243003: [telemetry] Consolidate global hooks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 6 years, 9 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 | tools/telemetry/telemetry/exception_formatter.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/__init__.py
diff --git a/tools/telemetry/telemetry/__init__.py b/tools/telemetry/telemetry/__init__.py
index cffbaac6bdb223004eaa66de39a574bec1e471eb..4d3fdc0101ba7df94a73d871ef0912e9ae28a718 100644
--- a/tools/telemetry/telemetry/__init__.py
+++ b/tools/telemetry/telemetry/__init__.py
@@ -9,18 +9,13 @@ import logging
import os
import sys
-
-# Ensure Python >= 2.7
+# Ensure Python >= 2.7.
if sys.version_info < (2, 7):
- logging.critical('Need Python 2.7 or greater.')
- sys.exit(1)
-
-
-from telemetry import exception_formatter
-exception_formatter.InstallUnhandledExceptionFormatter()
+ print >> sys.stderr, 'Need Python 2.7 or greater.'
+ sys.exit(-1)
-from telemetry import interactive_debugging
-interactive_debugging.InstallDebuggingHooks()
+from telemetry.util import global_hooks
+global_hooks.InstallHooks()
from telemetry.core.browser import Browser
from telemetry.core.browser_options import BrowserFinderOptions
@@ -43,32 +38,3 @@ for x in dir():
if (inspect.isclass(getattr(m, x)) or
inspect.isfunction(getattr(m, x))):
__all__.append(x)
-
-
-def RemoveAllStalePycFiles(base_dir):
- for dirname, _, filenames in os.walk(base_dir):
- if '.svn' in dirname or '.git' in dirname:
- continue
- for filename in filenames:
- root, ext = os.path.splitext(filename)
- if ext != '.pyc':
- continue
-
- pyc_path = os.path.join(dirname, filename)
- py_path = os.path.join(dirname, root + '.py')
-
- try:
- if not os.path.exists(py_path):
- os.remove(pyc_path)
- except OSError:
- # Wrap OS calls in try/except in case another process touched this file.
- pass
-
- try:
- os.removedirs(dirname)
- except OSError:
- # Wrap OS calls in try/except in case another process touched this dir.
- pass
-
-
-RemoveAllStalePycFiles(os.path.dirname(__file__))
« no previous file with comments | « no previous file | tools/telemetry/telemetry/exception_formatter.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698