Chromium Code Reviews| Index: tools/telemetry/telemetry/core/platform/util.py |
| diff --git a/tools/telemetry/telemetry/core/platform/util.py b/tools/telemetry/telemetry/core/platform/util.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9aa200712f41fce12f960df064ec730bf1c55a83 |
| --- /dev/null |
| +++ b/tools/telemetry/telemetry/core/platform/util.py |
| @@ -0,0 +1,20 @@ |
| +# Copyright (c) 2013 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. |
| + |
| +import sys |
| + |
| +from telemetry.core.platform import linux_platform_backend |
| +from telemetry.core.platform import mac_platform_backend |
| +from telemetry.core.platform import win_platform_backend |
| + |
| + |
| +def CreatePlatformBackendForCurrentOS(): |
|
tonyg
2013/07/31 20:59:33
Maybe this should go in platform/__init__.py inste
chrisgao (Use stgao instead)
2013/08/01 00:36:44
Done in https://codereview.chromium.org/21406004/.
|
| + if sys.platform.startswith('linux'): |
| + return linux_platform_backend.LinuxPlatformBackend() |
| + elif sys.platform == 'darwin': |
| + return mac_platform_backend.MacPlatformBackend() |
| + elif sys.platform == 'win32': |
| + return win_platform_backend.WinPlatformBackend() |
| + else: |
| + raise NotImplementedError() |